summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-29 04:19:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-29 04:19:25 (GMT)
commit67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b (patch)
tree43530142d45ca4e9489abcb76862b2c523c19f4c /t
parent2478bd8318c3ad6eceb7b99f01db29499f63b759 (diff)
parent92058e4d3e032714da6d2df5fa1fe2cf612979a5 (diff)
downloadgit-67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b.zip
git-67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b.tar.gz
git-67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b.tar.bz2
Merge branch 'jk/pager-with-external-command'
* jk/pager-with-external-command: support pager.* for external commands
Diffstat (limited to 't')
-rwxr-xr-xt/t7006-pager.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 4582336..320e1d1 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -450,4 +450,40 @@ test_expect_success TTY 'command-specific pager overridden by environment' '
test_cmp expect actual
'
+test_expect_success 'setup external command' '
+ cat >git-external <<-\EOF &&
+ #!/bin/sh
+ git "$@"
+ EOF
+ chmod +x git-external
+'
+
+test_expect_success TTY 'command-specific pager works for external commands' '
+ sane_unset PAGER GIT_PAGER &&
+ 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_cmp expect actual
+'
+
+test_expect_success TTY 'sub-commands of externals use their own pager' '
+ sane_unset PAGER GIT_PAGER &&
+ echo "foo:initial" >expect &&
+ >actual &&
+ test_config pager.log "sed s/^/foo:/ >actual" &&
+ test_terminal git --exec-path=. external log --format=%s -1 &&
+ test_cmp expect actual
+'
+
+test_expect_success TTY 'external command pagers override sub-commands' '
+ sane_unset PAGER GIT_PAGER &&
+ >expect &&
+ >actual &&
+ test_config pager.external false &&
+ test_config pager.log "sed s/^/log:/ >actual" &&
+ test_terminal git --exec-path=. external log --format=%s -1 &&
+ test_cmp expect actual
+'
+
test_done