Skip to content

Commit a4dfee0

Browse files
committed
t5505: fix "set-head --auto with ambiguous HEAD" test
When two or more branches point at the same commit and HEAD is pointing at one of them, without the symref extension, there is no way to remotely tell which one of these branches HEAD points at. The test in question attempts to make sure that this situation is diagnosed and results in a failure. However, even if there _were_ a way to reliably tell which branch the HEAD points at, "set-head --auto" would fail if there is no remote tracking branch. Make sure that this test does not fail for that "wrong" reason. Signed-off-by: Junio C Hamano <[email protected]>
1 parent e230c56 commit a4dfee0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t5505-remote.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ EOF
271271
test_expect_success 'set-head --auto fails w/multiple HEADs' '
272272
(
273273
cd test &&
274+
git fetch two "refs/heads/*:refs/remotes/two/*" &&
274275
test_must_fail git remote set-head --auto two >output 2>&1 &&
275276
test_i18ncmp expect output
276277
)

0 commit comments

Comments
 (0)