summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-07-10 13:58:57 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-07-10 13:58:58 -0700
commit040746c061c1138222d7db1f9ace292ef1a0935d (patch)
tree1cd0b022889ba7e8bb3672e6950f90002cd451d0 /t/t7006-pager.sh
parentMerge branch 'rs/pretty-add-again' into maint (diff)
parentalias: use the early config machinery to expand aliases (diff)
downloadtgif-040746c061c1138222d7db1f9ace292ef1a0935d.tar.xz
Merge branch 'js/alias-early-config' into maint
The code to pick up and execute command alias definition from the configuration used to switch to the top of the working tree and then come back when the expanded alias was executed, which was unnecessarilyl complex. Attempt to simplify the logic by using the early-config mechanism that does not chdir around. * js/alias-early-config: alias: use the early config machinery to expand aliases t7006: demonstrate a problem with aliases in subdirectories t1308: relax the test verifying that empty alias values are disallowed help: use early config when autocorrecting aliases config: report correct line number upon error discover_git_directory(): avoid setting invalid git_dir
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-xt/t7006-pager.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 4f3794d415..20b4d83c28 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -391,6 +391,17 @@ test_expect_success TTY 'core.pager in repo config works and retains cwd' '
)
'
+test_expect_success TTY 'core.pager is found via alias in subdirectory' '
+ sane_unset GIT_PAGER &&
+ test_config core.pager "cat >via-alias" &&
+ (
+ cd sub &&
+ rm -f via-alias &&
+ test_terminal git -c alias.r="-p rev-parse" r HEAD &&
+ test_path_is_file via-alias
+ )
+'
+
test_doesnt_paginate expect_failure test_must_fail 'git -p nonsense'
test_pager_choices 'git shortlog'