summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-08 19:24:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-08 19:24:14 (GMT)
commit23778ae9a08e9324f03898760b9e20b6b2dd6e23 (patch)
tree28f32b1e276fe01fdce276aff27f69a4b106319e /t/t7006-pager.sh
parent5e826019ef48e1d324c9a1866ed65f5be8990998 (diff)
parent9bad7233699e1fcf58e75f1e163499ec24680826 (diff)
downloadgit-23778ae9a08e9324f03898760b9e20b6b2dd6e23.zip
git-23778ae9a08e9324f03898760b9e20b6b2dd6e23.tar.gz
git-23778ae9a08e9324f03898760b9e20b6b2dd6e23.tar.bz2
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-xt/t7006-pager.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index e9d8b91..ed7575d 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