t1305: use `--git-dir=.` for bare repo in include cycle test

Earlier tests in t1305 overwrite `$HOME/.gitconfig` with their own content as part of testing config includes. This clobbers the `safe.bareRepository=all` entry that test-lib.sh writes when `WITH_BREAKING_CHANGES` is in effect, causing `git -C cycle config` to fail with "not in a git directory" when it tries to access the bare repository created by `git init --bare cycle`. Use `--git-dir=.` to access the bare repo explicitly, avoiding the dependency on global config for repository discovery. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Apr 26, 2026 at 14:38 UTC 59227c0e27b527062440200c074f63ee40fb7bf4
1 file changed +2 -2
t/t1305-config-include.sh
+2 -2
@@ -350,9 +350,9 @@ test_expect_success 'conditional include, onbranch, implicit /** for /' '
350
351 test_expect_success 'include cycles are detected' '
352 git init --bare cycle &&
353 - git -C cycle config include.path cycle &&
353 + git -C cycle --git-dir=. config include.path cycle &&
354 git config -f cycle/cycle include.path config &&
355 - test_must_fail git -C cycle config --get-all test.value 2>stderr &&
355 + test_must_fail git -C cycle --git-dir=. config --get-all test.value 2>stderr &&
356 grep "exceeded maximum include depth" stderr
357 '
358