@@ -102,9 +102,16 @@ test_expect_success LONG_REF 'we can parse long symbolic ref' '
test_cmp expect actual
'
+if test_have_prereq REFFILES
+then
+ HEAD_LOCK=HEAD.lock
+else
+ HEAD_LOCK=reftable/tables.list.lock
+fi
+
test_expect_success 'symbolic-ref reports failure in exit code' '
- test_when_finished "rm -f .git/HEAD.lock" &&
- >.git/HEAD.lock &&
+ test_when_finished "rm -f .git/$HEAD_LOCK" &&
+ >.git/$HEAD_LOCK &&
test_must_fail git symbolic-ref HEAD refs/heads/whatever
'
@@ -22,9 +22,16 @@ test_expect_success 'checkout main from invalid HEAD' '
git checkout main --
'
+if test_have_prereq REFFILES
+then
+ HEAD_LOCK=HEAD.lock
+else
+ HEAD_LOCK=reftable/tables.list.lock
+fi
+
test_expect_success 'checkout notices failure to lock HEAD' '
- test_when_finished "rm -f .git/HEAD.lock" &&
- >.git/HEAD.lock &&
+ test_when_finished "rm -f .git/$HEAD_LOCK" &&
+ >.git/$HEAD_LOCK &&
test_must_fail git checkout -b other
'