t7006: demonstrate a problem with aliases in subdirectories
commit3f9c5dfb7118256747de5efbaa4b5cd3f0e02331
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 14 Jun 2017 11:35:56 +0000 (14 13:35 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Jun 2017 19:31:43 +0000 (15 12:31 -0700)
tree26effeacc339fa7c6526d1f1f5a293e9fbf772cf
parente4feff4898f4705cc8df50e3dc152ed45ef06db6
t7006: demonstrate a problem with aliases in subdirectories

When expanding aliases, the git_dir is set during the alias expansion
(by virtue of running setup_git_directory_gently()).

This git_dir may be relative to the current working directory, and
indeed often is simply ".git/".

When the alias expands to a shell command, we restore the original
working directory, though, yet we do not reset git_dir.

As a consequence, subsequent read_early_config() runs will mistake the
git_dir to be populated properly and not find the correct config.

Demonstrate this problem by adding a test case.

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>
t/t7006-pager.sh