[PATCH 1/2] pager_in_use: use git_env_bool
- From
Jeff King <peff@peff.net>
- Date
- Aug 10, 2015, 05:19 UTC
- Message-ID
- <20150810051933.GA15441@sigill.intra.peff.net>
- In-Reply-To
- <20150810051901.GA9262@sigill.intra.peff.net>
This function basically reimplements git_env_bool (because it predates it). Let's reuse that helper, which is shorter and avoids repeating a string literal.
Signed-off-by: Jeff King <peff@peff.net> --- pager.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/pager.c b/pager.c index 070dc11..e3ad465 100644 --- a/pager.c +++ b/pager.c @@ -95,9 +95,7 @@ void setup_pager(void) int pager_in_use(void) { - const char *env; - env = getenv("GIT_PAGER_IN_USE"); - return env ? git_config_bool("GIT_PAGER_IN_USE", env) : 0; + return git_env_bool("GIT_PAGER_IN_USE", 0); } /*
-- 2.5.0.414.g670f2a4