Skip to content

Commit 9320b4e

Browse files
committed
t5503: avoid discovering a bare repository
The test case "fetch specific OID with tag following" creates a bare repository and wants to operate on it by changing the working directory and relying on Git's implicit discovery of the bare repository. Once the `safe.bareRepository` default is changed, this is no longer an option. So let's adjust the commands to specify the bare repository explicitly, via `--git-dir`, and avoid changing the working directory. As a bonus, the result is arguably more readable than the original code. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent a54a7d7 commit 9320b4e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

t/t5503-tagfollow.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,13 @@ test_expect_success 'new clone fetch main and tags' '
168168

169169
test_expect_success 'fetch specific OID with tag following' '
170170
git init --bare clone3.git &&
171-
(
172-
cd clone3.git &&
173-
git remote add origin .. &&
174-
git fetch origin $B:refs/heads/main &&
171+
git --git-dir=clone3.git remote add origin "$PWD" &&
172+
git --git-dir=clone3.git fetch origin $B:refs/heads/main &&
175173
176-
git -C .. for-each-ref >expect &&
177-
git for-each-ref >actual &&
174+
git for-each-ref >expect &&
175+
git --git-dir=clone3.git for-each-ref >actual &&
178176
179-
test_cmp expect actual
180-
)
177+
test_cmp expect actual
181178
'
182179

183180
test_done

0 commit comments

Comments
 (0)