summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-08-04 11:40:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-04 20:51:02 (GMT)
commit995bc22d7f8c611e342095a211065f8585a08e65 (patch)
treeb4f244806f75de3be427bff1411112a4f4bf1c39 /t/t7006-pager.sh
parent08df31eeccfe1576971ea4ba42570a424c3cfc41 (diff)
downloadgit-995bc22d7f8c611e342095a211065f8585a08e65.zip
git-995bc22d7f8c611e342095a211065f8585a08e65.tar.gz
git-995bc22d7f8c611e342095a211065f8585a08e65.tar.bz2
pager: move pager-specific setup into the build
Allowing PAGER_ENV to be set at build-time allows us to move pager-specific knowledge out of our build. This allows us to set a better default for FreeBSD more(1), which pretends not to understand ANSI color escapes if the MORE environment variable is left empty, but accepts the same variables as less(1) Originally-from: https://public-inbox.org/git/xmqq61piw4yf.fsf@gitster.dls.corp.google.com/ Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-xt/t7006-pager.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index e4fc5c8..c8dc665 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -49,6 +49,19 @@ test_expect_success TTY 'LESS and LV envvars are set for pagination' '
grep ^LV= pager-env.out
'
+test_expect_success !MINGW,TTY 'LESS and LV envvars set by git-sh-setup' '
+ (
+ sane_unset LESS LV &&
+ PAGER="env >pager-env.out; wc" &&
+ export PAGER &&
+ PATH="$(git --exec-path):$PATH" &&
+ export PATH &&
+ test_terminal sh -c ". git-sh-setup && git_pager"
+ ) &&
+ grep ^LESS= pager-env.out &&
+ grep ^LV= pager-env.out
+'
+
test_expect_success TTY 'some commands do not use a pager' '
rm -f paginated.out &&
test_terminal git rev-list HEAD &&