Skip to content

Commit a26f1fb

Browse files
jltoblergitster
authored andcommitted
t1401: remove lockfile creation
To create error conditions, some tests set up reference locks by directly creating its lockfile. While this works for the files reference backend, this approach is incompatible with the reftable backend. Refactor the test to create a d/f conflict via git-symbolic-ref(1) instead so that the test is reference backend agnostic. Signed-off-by: Justin Tobler <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a54a84b commit a26f1fb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/t1401-symbolic-ref.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ test_expect_success LONG_REF 'we can parse long symbolic ref' '
106106
'
107107

108108
test_expect_success 'symbolic-ref reports failure in exit code' '
109-
test_when_finished "rm -f .git/HEAD.lock" &&
110-
>.git/HEAD.lock &&
111-
test_must_fail git symbolic-ref HEAD refs/heads/whatever
109+
# Create d/f conflict to simulate failure.
110+
test_must_fail git symbolic-ref refs/heads refs/heads/foo
112111
'
113112

114113
test_expect_success 'symbolic-ref writes reflog entry' '

0 commit comments

Comments
 (0)