Skip to content

Commit b49831c

Browse files
pks-tgitster
authored andcommitted
t1401: stop treating FETCH_HEAD as real reference
One of the tests in t1401 asserts that we can create a symref from a symbolic reference to a top-level reference, which is done by linking from `refs/heads/top-level` to `FETCH_HEAD`. But `FETCH_HEAD` is not a proper reference and doesn't even follow the loose reference format, so it is not a good candidate for the logic under test. Refactor the test to use `ORIG_HEAD` instead of `FETCH_HEAD`. This also works with other backends than the reffiles one. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent db7288b commit b49831c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t1401-symbolic-ref.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ test_expect_success 'symbolic-ref refuses invalid target for non-HEAD' '
171171
'
172172

173173
test_expect_success 'symbolic-ref allows top-level target for non-HEAD' '
174-
git symbolic-ref refs/heads/top-level FETCH_HEAD &&
175-
git update-ref FETCH_HEAD HEAD &&
174+
git symbolic-ref refs/heads/top-level ORIG_HEAD &&
175+
git update-ref ORIG_HEAD HEAD &&
176176
test_cmp_rev top-level HEAD
177177
'
178178

0 commit comments

Comments
 (0)