Thread (8 messages) 8 messages, 3 authors, 2016-06-15
STALE3645d

[PATCH 1/2] pager_in_use: use git_env_bool

From: Jeff King <hidden>
Date: 2016-06-15 23:06:07
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help