diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-08 11:24:14 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-08 11:24:14 -0800 |
commit | 23778ae9a08e9324f03898760b9e20b6b2dd6e23 (patch) | |
tree | 28f32b1e276fe01fdce276aff27f69a4b106319e /t/t7006-pager.sh | |
parent | 5e826019ef48e1d324c9a1866ed65f5be8990998 (diff) | |
parent | 9bad7233699e1fcf58e75f1e163499ec24680826 (diff) | |
download | git-23778ae9a08e9324f03898760b9e20b6b2dd6e23.tar.gz |
Merge branch 'jk/pager-per-command'
* jk/pager-per-command:
allow command-specific pagers in pager.<cmd>
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-x | t/t7006-pager.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index e9d8b9110d..ed7575d0fd 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -401,4 +401,33 @@ test_core_pager_subdir expect_success 'git -p shortlog' test_core_pager_subdir expect_success test_must_fail \ 'git -p apply </dev/null' +test_expect_success TTY 'command-specific pager' ' + unset PAGER GIT_PAGER; + echo "foo:initial" >expect && + >actual && + git config --unset core.pager && + git config pager.log "sed s/^/foo:/ >actual" && + test_terminal git log --format=%s -1 && + test_cmp expect actual +' + +test_expect_success TTY 'command-specific pager overrides core.pager' ' + unset PAGER GIT_PAGER; + echo "foo:initial" >expect && + >actual && + git config core.pager "exit 1" + git config pager.log "sed s/^/foo:/ >actual" && + test_terminal git log --format=%s -1 && + test_cmp expect actual +' + +test_expect_success TTY 'command-specific pager overridden by environment' ' + GIT_PAGER="sed s/^/foo:/ >actual" && export GIT_PAGER && + >actual && + echo "foo:initial" >expect && + git config pager.log "exit 1" && + test_terminal git log --format=%s -1 && + test_cmp expect actual +' + test_done |