Merge branch 'jk/pager-bypass-cat-for-default-pager'
authorJunio C Hamano <gitster@pobox.com>
Wed, 18 Sep 2013 18:42:15 +0000 (11:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Sep 2013 18:42:16 +0000 (11:42 -0700)
If a build-time fallback is set to "cat" instead of "less", we
should apply the same "no subprocess or pipe" optimization as we
apply to user-supplied GIT_PAGER=cat.

* jk/pager-bypass-cat-for-default-pager:
pager: turn on "cat" optimization for DEFAULT_PAGER

pager.c
diff --git a/pager.c b/pager.c
index c1ecf657fdb32c1fa669f08ba33e358f15c5a07b..fa19765eb9e60d2dbc17887773fff4ad66a32c37 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -54,7 +54,7 @@ const char *git_pager(int stdout_is_tty)
                pager = getenv("PAGER");
        if (!pager)
                pager = DEFAULT_PAGER;
-       else if (!*pager || !strcmp(pager, "cat"))
+       if (!*pager || !strcmp(pager, "cat"))
                pager = NULL;
 
        return pager;