summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-08-05 22:12:46 -0500
committerJunio C Hamano <gitster@pobox.com>2010-08-15 19:57:33 -0700
commit2cb60093e6c6b53cfc8ffe75f697386a1adab778 (patch)
tree43c4e669242644580daf10fe2b34b3fbdd156932 /t/t7006-pager.sh
parentd1ea896290629185dc0bf4efa3469b410bd41313 (diff)
downloadgit-2cb60093e6c6b53cfc8ffe75f697386a1adab778.tar.gz
bundle: run setup_git_directory_gently() sooner
Without this change, “git -p bundle” does not always respect the repository-local “[core] pager” setting. It is hard to notice because subcommands other than “git bundle unbundle” do not produce much output. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-xt/t7006-pager.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 6c86d7035f..1890c65fa1 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -58,6 +58,21 @@ test_expect_success TTY 'some commands use a pager' '
test -e paginated.out
'
+test_expect_failure TTY 'pager runs from subdir' '
+ echo subdir/paginated.out >expected &&
+ mkdir -p subdir &&
+ rm -f paginated.out subdir/paginated.out &&
+ (
+ cd subdir &&
+ test_terminal git log
+ ) &&
+ {
+ ls paginated.out subdir/paginated.out ||
+ :
+ } >actual &&
+ test_cmp expected actual
+'
+
test_expect_success TTY 'some commands do not use a pager' '
rm -f paginated.out ||
cleanup_fail &&
@@ -119,6 +134,24 @@ test_expect_success TTY 'configuration can disable pager' '
! test -e paginated.out
'
+test_expect_success 'configuration can enable pager (from subdir)' '
+ rm -f paginated.out &&
+ mkdir -p subdir &&
+ git config pager.bundle true &&
+ test_when_finished "git config --unset pager.bundle" &&
+
+ git bundle create test.bundle --all &&
+ rm -f paginated.out subdir/paginated.out &&
+ (
+ cd subdir &&
+ test_terminal git bundle unbundle ../test.bundle
+ ) &&
+ {
+ test -e paginated.out ||
+ test -e subdir/paginated.out
+ }
+'
+
# A colored commit log will begin with an appropriate ANSI escape
# for the first color; the text "commit" comes later.
colorful() {