diff options
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-x | t/t7006-pager.sh | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index 947b690fd7..c8dc665f2f 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 && @@ -424,7 +437,7 @@ test_expect_success TTY 'command-specific pager works for external commands' ' echo "foo:initial" >expect && >actual && test_config pager.external "sed s/^/foo:/ >actual" && - test_terminal git --exec-path="`pwd`" external log --format=%s -1 && + test_terminal git --exec-path="$(pwd)" external log --format=%s -1 && test_cmp expect actual ' @@ -447,4 +460,13 @@ test_expect_success TTY 'external command pagers override sub-commands' ' test_cmp expect actual ' +test_expect_success 'command with underscores does not complain' ' + write_script git-under_score <<-\EOF && + echo ok + EOF + git --exec-path=. under_score >actual 2>&1 && + echo ok >expect && + test_cmp expect actual +' + test_done |