config: handle conditional include when $GIT_DIR is not set up
[gitweb.git] / t / t1305-config-include.sh
index e8339393203c65fac29a647c5a0f827cf24a4cbb..fddb47bafa62d967e9964c65363afc42c848397d 100755 (executable)
@@ -208,6 +208,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 'include cycles are detected' '
        cat >.gitconfig <<-\EOF &&
        [test]value = gitconfig