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 <jltobler@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Justin Tobler committed Jan 11, 2024 at 20:24 UTC a26f1fb62bef37865dc18e010f9804172980c682
1 file changed +2 -3
t/t1401-symbolic-ref.sh
+2 -3
@@ -106,9 +106,8 @@ test_expect_success LONG_REF 'we can parse long symbolic ref' '
106 '
107
108 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
111 '
112
113 test_expect_success 'symbolic-ref writes reflog entry' '