Subject: [PATCH v2 14/17] t6020: use `-C` for worktree, `--git-dir` for bare repository

From: "Johannes Schindelin via GitGitGadget" <[email-masked]>
Date: Sat, 04 Apr 2026 19:49:54 +0000

From: Johannes Schindelin <[email-masked]>

To prepare for `safe.bareRepository` defaulting to `explicit`
(see 8d1a7448206e), adjust a loop that iterated over both a
bare (`cloned`) and a non-bare (`unbundled`) repository using
the same `-C` flag: the bare repo needs `--git-dir` to avoid
implicit discovery, while the non-bare one keeps `-C`.

Signed-off-by: Johannes Schindelin <[email-masked]>
---
 t/t6020-bundle-misc.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh
index 500c81b8a1..82df105b47 100755
--- a/t/t6020-bundle-misc.sh
+++ b/t/t6020-bundle-misc.sh
@@ -594,9 +594,9 @@ do
 		reflist=$(git for-each-ref --format="%(objectname)") &&
 		git rev-list --objects --filter=$filter --missing=allow-any \
 			$reflist >expect &&
-		for repo in cloned unbundled
+		for opt in "--git-dir cloned" "-C unbundled"
 		do
-			git -C $repo rev-list --objects --missing=allow-any \
+			git $opt rev-list --objects --missing=allow-any \
 				$reflist >actual &&
 			test_cmp expect actual || return 1
 		done
-- 
gitgitgadget