t: mark several tests that assume the files backend with REFFILES
Add the REFFILES prerequisite to several tests that assume we're using the files backend. There are various reasons why we cannot easily convert those tests to be backend-independent, where the most common one is that we have no way to write corrupt references into the refdb via our tooling. We may at a later point in time grow the tooling to make this possible, but for now we just mark these tests as requiring the files backend. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Nov 2, 2023 at 09:47 UTC
a6f43364e3dc1eedf18b241f41bbd4abfd640fb4
6 files changed
+21
-21
t/t1400-update-ref.sh
+4
-4
@@ -236,7 +236,7 @@ test_expect_success 'update-ref --no-deref -d can delete self-reference' '
236
test_must_fail git show-ref --verify -q refs/heads/self
237
'
238
239
-test_expect_success 'update-ref --no-deref -d can delete reference to bad ref' '
239
+test_expect_success REFFILES 'update-ref --no-deref -d can delete reference to bad ref' '
240
>.git/refs/heads/bad &&
241
test_when_finished "rm -f .git/refs/heads/bad" &&
242
git symbolic-ref refs/heads/ref-to-bad refs/heads/bad &&
@@ -288,7 +288,7 @@ test_expect_success "set $m (logged by touch)" '
288
test $A = $(git show-ref -s --verify $m)
289
'
290
291
-test_expect_success 'empty directory removal' '
291
+test_expect_success REFFILES 'empty directory removal' '
292
git branch d1/d2/r1 HEAD &&
293
git branch d1/r2 HEAD &&
294
test_path_is_file .git/refs/heads/d1/d2/r1 &&
@@ -300,7 +300,7 @@ test_expect_success 'empty directory removal' '
300
test_path_is_file .git/logs/refs/heads/d1/r2
301
'
302
303
-test_expect_success 'symref empty directory removal' '
303
+test_expect_success REFFILES 'symref empty directory removal' '
304
git branch e1/e2/r1 HEAD &&
305
git branch e1/r2 HEAD &&
306
git checkout e1/e2/r1 &&
@@ -1639,7 +1639,7 @@ test_expect_success PIPE 'transaction flushes status updates' '
1639
test_cmp expected actual
1640
'
1641
1642
-test_expect_success 'directory not created deleting packed ref' '
1642
+test_expect_success REFFILES 'directory not created deleting packed ref' '
1643
git branch d1/d2/r1 HEAD &&
1644
git pack-refs --all &&
1645
test_path_is_missing .git/refs/heads/d1/d2 &&
t/t1450-fsck.sh
+3
-3
@@ -123,7 +123,7 @@ test_expect_success 'branch pointing to non-commit' '
123
test_i18ngrep "not a commit" out
124
'
125
126
-test_expect_success 'HEAD link pointing at a funny object' '
126
+test_expect_success REFFILES 'HEAD link pointing at a funny object' '
127
test_when_finished "git update-ref HEAD $orig_head" &&
128
echo $ZERO_OID >.git/HEAD &&
129
# avoid corrupt/broken HEAD from interfering with repo discovery
@@ -139,7 +139,7 @@ test_expect_success 'HEAD link pointing at a funny place' '
139
test_i18ngrep "HEAD points to something strange" out
140
'
141
142
-test_expect_success 'HEAD link pointing at a funny object (from different wt)' '
142
+test_expect_success REFFILES 'HEAD link pointing at a funny object (from different wt)' '
143
test_when_finished "git update-ref HEAD $orig_head" &&
144
test_when_finished "git worktree remove -f wt" &&
145
git worktree add wt &&
@@ -149,7 +149,7 @@ test_expect_success 'HEAD link pointing at a funny object (from different wt)' '
149
test_i18ngrep "main-worktree/HEAD: detached HEAD points" out
150
'
151
152
-test_expect_success 'other worktree HEAD link pointing at a funny object' '
152
+test_expect_success REFFILES 'other worktree HEAD link pointing at a funny object' '
153
test_when_finished "git worktree remove -f other" &&
154
git worktree add other &&
155
echo $ZERO_OID >.git/worktrees/other/HEAD &&
t/t2011-checkout-invalid-head.sh
+8
-8
@@ -18,18 +18,18 @@ test_expect_success 'checkout should not start branch from a tree' '
18
test_must_fail git checkout -b newbranch main^{tree}
19
'
20
21
-test_expect_success 'checkout main from invalid HEAD' '
21
+test_expect_success REFFILES 'checkout main from invalid HEAD' '
22
echo $ZERO_OID >.git/HEAD &&
23
git checkout main --
24
'
25
26
-test_expect_success 'checkout notices failure to lock HEAD' '
26
+test_expect_success REFFILES 'checkout notices failure to lock HEAD' '
27
test_when_finished "rm -f .git/HEAD.lock" &&
28
>.git/HEAD.lock &&
29
test_must_fail git checkout -b other
30
'
31
32
-test_expect_success 'create ref directory/file conflict scenario' '
32
+test_expect_success REFFILES 'create ref directory/file conflict scenario' '
33
git update-ref refs/heads/outer/inner main &&
34
35
# do not rely on symbolic-ref to get a known state,
@@ -39,26 +39,26 @@ test_expect_success 'create ref directory/file conflict scenario' '
39
}
40
'
41
42
-test_expect_success 'checkout away from d/f HEAD (unpacked, to branch)' '
42
+test_expect_success REFFILES 'checkout away from d/f HEAD (unpacked, to branch)' '
43
reset_to_df &&
44
git checkout main
45
'
46
47
-test_expect_success 'checkout away from d/f HEAD (unpacked, to detached)' '
47
+test_expect_success REFFILES 'checkout away from d/f HEAD (unpacked, to detached)' '
48
reset_to_df &&
49
git checkout --detach main
50
'
51
52
-test_expect_success 'pack refs' '
52
+test_expect_success REFFILES 'pack refs' '
53
git pack-refs --all --prune
54
'
55
56
-test_expect_success 'checkout away from d/f HEAD (packed, to branch)' '
56
+test_expect_success REFFILES 'checkout away from d/f HEAD (packed, to branch)' '
57
reset_to_df &&
58
git checkout main
59
'
60
61
-test_expect_success 'checkout away from d/f HEAD (packed, to detached)' '
61
+test_expect_success REFFILES 'checkout away from d/f HEAD (packed, to detached)' '
62
reset_to_df &&
63
git checkout --detach main
64
'
t/t3200-branch.sh
+4
-4
@@ -28,7 +28,7 @@ test_expect_success 'git branch --help should not have created a bogus branch' '
28
test_ref_missing refs/heads/--help
29
'
30
31
-test_expect_success 'branch -h in broken repository' '
31
+test_expect_success REFFILES 'branch -h in broken repository' '
32
mkdir broken &&
33
(
34
cd broken &&
@@ -245,7 +245,7 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
245
git worktree prune
246
'
247
248
-test_expect_success 'git branch -M fails if updating any linked working tree fails' '
248
+test_expect_success REFFILES 'git branch -M fails if updating any linked working tree fails' '
249
git worktree add -b baz bazdir1 &&
250
git worktree add -f bazdir2 baz &&
251
touch .git/worktrees/bazdir1/HEAD.lock &&
@@ -836,14 +836,14 @@ test_expect_success 'renaming a symref is not allowed' '
836
test_ref_missing refs/heads/new-topic
837
'
838
839
-test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
839
+test_expect_success SYMLINKS,REFFILES 'git branch -m u v should fail when the reflog for u is a symlink' '
840
git branch --create-reflog u &&
841
mv .git/logs/refs/heads/u real-u &&
842
ln -s real-u .git/logs/refs/heads/u &&
843
test_must_fail git branch -m u v
844
'
845
846
-test_expect_success SYMLINKS 'git branch -m with symlinked .git/refs' '
846
+test_expect_success SYMLINKS,REFFILES 'git branch -m with symlinked .git/refs' '
847
test_when_finished "rm -rf subdir" &&
848
git init --bare subdir &&
849
t/t3400-rebase.sh
+1
-1
@@ -424,7 +424,7 @@ test_expect_success 'refuse to switch to branch checked out elsewhere' '
424
test_i18ngrep "already used by worktree at" err
425
'
426
427
-test_expect_success MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' '
427
+test_expect_success REFFILES,MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' '
428
git checkout main &&
429
mv .git/logs actual_logs &&
430
cmd //c "mklink /D .git\logs ..\actual_logs" &&
t/t5605-clone-local.sh
+1
-1
@@ -157,7 +157,7 @@ test_expect_success 'cloning locally respects "-u" for fetching refs' '
157
test_must_fail git clone --bare -u false a should_not_work.git
158
'
159
160
-test_expect_success 'local clone from repo with corrupt refs fails gracefully' '
160
+test_expect_success REFFILES 'local clone from repo with corrupt refs fails gracefully' '
161
git init corrupt &&
162
test_commit -C corrupt one &&
163
echo a >corrupt/.git/refs/heads/topic &&