diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-04-26 15:39:05 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-26 15:39:05 +0900 |
commit | c9672ba4c86a5fb18ea20d1c4a2c0eb6a731f3cb (patch) | |
tree | 47c0d32f51053046b1a47b3113d8803f2a7c1279 /t | |
parent | Merge branch 'ab/push-cas-doc-n-test' (diff) | |
parent | config: correct file reading order in read_early_config() (diff) | |
download | tgif-c9672ba4c86a5fb18ea20d1c4a2c0eb6a731f3cb.tar.xz |
Merge branch 'nd/conditional-config-in-early-config'
The recently introduced conditional inclusion of configuration did
not work well when early-config mechanism was involved.
* nd/conditional-config-in-early-config:
config: correct file reading order in read_early_config()
config: handle conditional include when $GIT_DIR is not set up
config: prepare to pass more info in git_config_with_options()
Diffstat (limited to 't')
-rwxr-xr-x | t/t1305-config-include.sh | 11 | ||||
-rwxr-xr-x | t/t1309-early-config.sh | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh index 8fbc7a029f..933915ec06 100755 --- a/t/t1305-config-include.sh +++ b/t/t1305-config-include.sh @@ -218,6 +218,17 @@ test_expect_success 'conditional include, both unanchored, icase' ' ) ' +test_expect_success 'conditional include, early config reading' ' + ( + cd foo && + echo "[includeIf \"gitdir:foo/\"]path=bar6" >>.git/config && + echo "[test]six=6" >.git/bar6 && + echo 6 >expect && + test-config read_early_config test.six >actual && + test_cmp expect actual + ) +' + test_expect_success SYMLINKS 'conditional include, set up symlinked $HOME' ' mkdir real-home && ln -s real-home home && diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh index b97357b8ab..1af8c454cf 100755 --- a/t/t1309-early-config.sh +++ b/t/t1309-early-config.sh @@ -47,6 +47,24 @@ test_expect_success 'ceiling #2' ' test xdg = "$(cat output)" ' +cmdline_config="'test.source=cmdline'" +test_expect_success 'read config file in right order' ' + echo "[test]source = home" >>.gitconfig && + git init foo && + ( + cd foo && + echo "[test]source = repo" >>.git/config && + GIT_CONFIG_PARAMETERS=$cmdline_config test-config \ + read_early_config test.source >actual && + cat >expected <<-\EOF && + home + repo + cmdline + EOF + test_cmp expected actual + ) +' + test_with_config () { rm -rf throwaway && git init throwaway && |