Subject: [PATCH v2 10/17] t5505: export `GIT_DIR` after `git init --bare`

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

From: Johannes Schindelin <[email-masked]>

To prepare for `safe.bareRepository` defaulting to `explicit` (see
8d1a7448206e), export `GIT_DIR=.` right after `git init --bare &&` so
subsequent commands access the bare repo explicitly.

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

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index e592c0bcde..6d3d8510ca 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -561,7 +561,7 @@ test_expect_success 'add --mirror && prune' '
 	mkdir mirror &&
 	(
 		cd mirror &&
-		git init --bare &&
+		git init --bare && GIT_DIR=. && export GIT_DIR &&
 		git remote add --mirror -f origin ../one
 	) &&
 	(
@@ -583,7 +583,7 @@ test_expect_success 'add --mirror setting HEAD' '
 	mkdir headmirror &&
 	(
 		cd headmirror &&
-		git init --bare -b notmain &&
+		git init --bare -b notmain && GIT_DIR=. && export GIT_DIR &&
 		git remote add --mirror -f origin ../one &&
 		test "$(git symbolic-ref HEAD)" = "refs/heads/main"
 	)
-- 
gitgitgadget