[PATCH v2 10/17] t5505: export `GIT_DIR` after `git init --bare`
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 4, 2026, 19:49 UTC
- Message-ID
- <6932658411309228d2d670d9b6c2e4be4f17f985.1775332197.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2076.v2.git.1775332197.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
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 <johannes.schindelin@gmx.de> --- 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