summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-06-14 11:36:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-15 19:31:50 (GMT)
commita9bcf6586d1a4888aea91553d73cda20494b8335 (patch)
treeda27bd4c2204d171c8752abddb467447eac86cfb /t/t7006-pager.sh
parent3f9c5dfb7118256747de5efbaa4b5cd3f0e02331 (diff)
downloadgit-a9bcf6586d1a4888aea91553d73cda20494b8335.zip
git-a9bcf6586d1a4888aea91553d73cda20494b8335.tar.gz
git-a9bcf6586d1a4888aea91553d73cda20494b8335.tar.bz2
alias: use the early config machinery to expand aliases
Instead of discovering the .git/ directory, reading the config and then trying to painstakingly reset all the global state if we did not find a matching alias, let's use the early config machinery instead. It may look like unnecessary work to discover the .git/ directory in the early config machinery and then call setup_git_directory_gently() in the case of a shell alias, repeating the very same discovery *again*. However, we have to do this as the early config machinery takes pains *not* to touch any global state, while shell aliases expect a possibly changed working directory and at least the GIT_PREFIX and GIT_DIR variables to be set. This change also fixes a known issue where Git tried to read the pager config from an incorrect path in a subdirectory of a Git worktree if an alias expanded to a shell command. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-xt/t7006-pager.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 83881ec..20b4d83 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -391,7 +391,7 @@ test_expect_success TTY 'core.pager in repo config works and retains cwd' '
)
'
-test_expect_failure TTY 'core.pager is found via alias in subdirectory' '
+test_expect_success TTY 'core.pager is found via alias in subdirectory' '
sane_unset GIT_PAGER &&
test_config core.pager "cat >via-alias" &&
(