Subject: [PATCH 08/17] t2406: use `--git-dir=.` for bare repository worktree repair

From: "Johannes Schindelin via GitGitGadget" <[email-masked]>
Date: Thu, 02 Apr 2026 14:33:14 +0000

From: Johannes Schindelin <[email-masked]>

To prepare for `safe.bareRepository` defaulting to `explicit` (see
8d1a7448206e), the test case t2406.10(repair .git file from bare.git)
cannot rely on the implicit discovery of thee bare repository. Simply
add a `--git-dir=.` to the invocation. The `-C bare.git` argument is
still needed so that the `repair` command realizes works on the intended
directory.

Signed-off-by: Johannes Schindelin <[email-masked]>
---
 t/t2406-worktree-repair.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t2406-worktree-repair.sh b/t/t2406-worktree-repair.sh
index f5f19b3169..cac448b575 100755
--- a/t/t2406-worktree-repair.sh
+++ b/t/t2406-worktree-repair.sh
@@ -84,7 +84,7 @@ test_expect_success 'repair .git file from bare.git' '
 	git -C bare.git worktree add --detach ../corrupt &&
 	git -C corrupt rev-parse --absolute-git-dir >expect &&
 	rm -f corrupt/.git &&
-	git -C bare.git worktree repair &&
+	git -C bare.git --git-dir=. worktree repair &&
 	git -C corrupt rev-parse --absolute-git-dir >actual &&
 	test_cmp expect actual
 '
-- 
gitgitgadget