git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Alex Henrie <alexhenrie24@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git mailing list <git@vger.kernel.org>
Subject: [PATCH] pager_in_use: use git_env_bool()
Date: Fri, 24 Mar 2017 14:59:12 -0400	[thread overview]
Message-ID: <20170324185912.rvzi46kr5ldxnehm@sigill.intra.peff.net> (raw)
In-Reply-To: <20170324185543.uq4clqyvbdkahbzo@sigill.intra.peff.net>

On Fri, Mar 24, 2017 at 02:55:43PM -0400, Jeff King wrote:

> But I was concerned that there might be a bug in pager_in_use(), so I
> dug into it a little. I think the code there is correct; [...]

I did see this small cleanup opportunity, though.

-- >8 --
Subject: [PATCH] pager_in_use: use git_env_bool()

The pager_in_use() function predates git_env_bool(), but
ends up doing the same thing.  Let's make use of the latter,
which is shorter and less repetitive.

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 73ca8bc3b..c113d898a 100644
--- a/pager.c
+++ b/pager.c
@@ -135,9 +135,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.12.1.843.g1937c56c2


  reply	other threads:[~2017-03-24 18:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21  5:52 [PATCH] log: if --decorate is not given, default to --decorate=auto Alex Henrie
2017-03-21 17:34 ` Junio C Hamano
2017-03-21 22:28   ` Junio C Hamano
2017-03-22  5:47     ` Alex Henrie
2017-03-22 16:54       ` Junio C Hamano
2017-03-23 15:07         ` Alex Henrie
2017-03-23 15:54           ` Junio C Hamano
2017-03-23 16:52             ` Alex Henrie
2017-03-23 18:03               ` Junio C Hamano
2017-03-24  5:45                 ` Alex Henrie
2017-03-24 18:55               ` Jeff King
2017-03-24 18:59                 ` Jeff King [this message]
2017-03-24 19:13                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170324185912.rvzi46kr5ldxnehm@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=alexhenrie24@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).