diff options
| author | Justin Tobler <jltobler@gmail.com> | 2024-01-11 20:24:29 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-12 09:56:47 -0800 |
| commit | a26f1fb62bef37865dc18e010f9804172980c682 (patch) | |
| tree | 34b9428e3d348ca86744783f047083552539d84f | |
| parent | a54a84b333adbecf7bc4483c0e36ed5878cac17b (diff) | |
| download | git-a26f1fb62bef37865dc18e010f9804172980c682.tar.xz | |
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>
| -rwxr-xr-x | t/t1401-symbolic-ref.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh index 3241d35917..5c60d6f812 100755 --- a/t/t1401-symbolic-ref.sh +++ b/t/t1401-symbolic-ref.sh @@ -106,9 +106,8 @@ test_expect_success LONG_REF 'we can parse long symbolic ref' ' ' test_expect_success 'symbolic-ref reports failure in exit code' ' - test_when_finished "rm -f .git/HEAD.lock" && - >.git/HEAD.lock && - test_must_fail git symbolic-ref HEAD refs/heads/whatever + # Create d/f conflict to simulate failure. + test_must_fail git symbolic-ref refs/heads refs/heads/foo ' test_expect_success 'symbolic-ref writes reflog entry' ' |
