Skip to content

Commit a6f4336

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 170ba45 commit a6f4336

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

t/t1400-update-ref.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ test_expect_success 'update-ref --no-deref -d can delete self-reference' '
236236
test_must_fail git show-ref --verify -q refs/heads/self
237237
'
238238

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' '
240240
>.git/refs/heads/bad &&
241241
test_when_finished "rm -f .git/refs/heads/bad" &&
242242
git symbolic-ref refs/heads/ref-to-bad refs/heads/bad &&
@@ -288,7 +288,7 @@ test_expect_success "set $m (logged by touch)" '
288288
test $A = $(git show-ref -s --verify $m)
289289
'
290290

291-
test_expect_success 'empty directory removal' '
291+
test_expect_success REFFILES 'empty directory removal' '
292292
git branch d1/d2/r1 HEAD &&
293293
git branch d1/r2 HEAD &&
294294
test_path_is_file .git/refs/heads/d1/d2/r1 &&
@@ -300,7 +300,7 @@ test_expect_success 'empty directory removal' '
300300
test_path_is_file .git/logs/refs/heads/d1/r2
301301
'
302302

303-
test_expect_success 'symref empty directory removal' '
303+
test_expect_success REFFILES 'symref empty directory removal' '
304304
git branch e1/e2/r1 HEAD &&
305305
git branch e1/r2 HEAD &&
306306
git checkout e1/e2/r1 &&
@@ -1639,7 +1639,7 @@ test_expect_success PIPE 'transaction flushes status updates' '
16391639
test_cmp expected actual
16401640
'
16411641

1642-
test_expect_success 'directory not created deleting packed ref' '
1642+
test_expect_success REFFILES 'directory not created deleting packed ref' '
16431643
git branch d1/d2/r1 HEAD &&
16441644
git pack-refs --all &&
16451645
test_path_is_missing .git/refs/heads/d1/d2 &&

t/t1450-fsck.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ test_expect_success 'branch pointing to non-commit' '
123123
test_i18ngrep "not a commit" out
124124
'
125125

126-
test_expect_success 'HEAD link pointing at a funny object' '
126+
test_expect_success REFFILES 'HEAD link pointing at a funny object' '
127127
test_when_finished "git update-ref HEAD $orig_head" &&
128128
echo $ZERO_OID >.git/HEAD &&
129129
# avoid corrupt/broken HEAD from interfering with repo discovery
@@ -139,7 +139,7 @@ test_expect_success 'HEAD link pointing at a funny place' '
139139
test_i18ngrep "HEAD points to something strange" out
140140
'
141141

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)' '
143143
test_when_finished "git update-ref HEAD $orig_head" &&
144144
test_when_finished "git worktree remove -f wt" &&
145145
git worktree add wt &&
@@ -149,7 +149,7 @@ test_expect_success 'HEAD link pointing at a funny object (from different wt)' '
149149
test_i18ngrep "main-worktree/HEAD: detached HEAD points" out
150150
'
151151

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' '
153153
test_when_finished "git worktree remove -f other" &&
154154
git worktree add other &&
155155
echo $ZERO_OID >.git/worktrees/other/HEAD &&

t/t2011-checkout-invalid-head.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ test_expect_success 'checkout should not start branch from a tree' '
1818
test_must_fail git checkout -b newbranch main^{tree}
1919
'
2020

21-
test_expect_success 'checkout main from invalid HEAD' '
21+
test_expect_success REFFILES 'checkout main from invalid HEAD' '
2222
echo $ZERO_OID >.git/HEAD &&
2323
git checkout main --
2424
'
2525

26-
test_expect_success 'checkout notices failure to lock HEAD' '
26+
test_expect_success REFFILES 'checkout notices failure to lock HEAD' '
2727
test_when_finished "rm -f .git/HEAD.lock" &&
2828
>.git/HEAD.lock &&
2929
test_must_fail git checkout -b other
3030
'
3131

32-
test_expect_success 'create ref directory/file conflict scenario' '
32+
test_expect_success REFFILES 'create ref directory/file conflict scenario' '
3333
git update-ref refs/heads/outer/inner main &&
3434
3535
# do not rely on symbolic-ref to get a known state,
@@ -39,26 +39,26 @@ test_expect_success 'create ref directory/file conflict scenario' '
3939
}
4040
'
4141

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)' '
4343
reset_to_df &&
4444
git checkout main
4545
'
4646

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)' '
4848
reset_to_df &&
4949
git checkout --detach main
5050
'
5151

52-
test_expect_success 'pack refs' '
52+
test_expect_success REFFILES 'pack refs' '
5353
git pack-refs --all --prune
5454
'
5555

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)' '
5757
reset_to_df &&
5858
git checkout main
5959
'
6060

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)' '
6262
reset_to_df &&
6363
git checkout --detach main
6464
'

t/t3200-branch.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_expect_success 'git branch --help should not have created a bogus branch' '
2828
test_ref_missing refs/heads/--help
2929
'
3030

31-
test_expect_success 'branch -h in broken repository' '
31+
test_expect_success REFFILES 'branch -h in broken repository' '
3232
mkdir broken &&
3333
(
3434
cd broken &&
@@ -245,7 +245,7 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
245245
git worktree prune
246246
'
247247

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' '
249249
git worktree add -b baz bazdir1 &&
250250
git worktree add -f bazdir2 baz &&
251251
touch .git/worktrees/bazdir1/HEAD.lock &&
@@ -836,14 +836,14 @@ test_expect_success 'renaming a symref is not allowed' '
836836
test_ref_missing refs/heads/new-topic
837837
'
838838

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' '
840840
git branch --create-reflog u &&
841841
mv .git/logs/refs/heads/u real-u &&
842842
ln -s real-u .git/logs/refs/heads/u &&
843843
test_must_fail git branch -m u v
844844
'
845845

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' '
847847
test_when_finished "rm -rf subdir" &&
848848
git init --bare subdir &&
849849

t/t3400-rebase.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ test_expect_success 'refuse to switch to branch checked out elsewhere' '
424424
test_i18ngrep "already used by worktree at" err
425425
'
426426

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' '
428428
git checkout main &&
429429
mv .git/logs actual_logs &&
430430
cmd //c "mklink /D .git\logs ..\actual_logs" &&

t/t5605-clone-local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ test_expect_success 'cloning locally respects "-u" for fetching refs' '
157157
test_must_fail git clone --bare -u false a should_not_work.git
158158
'
159159

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' '
161161
git init corrupt &&
162162
test_commit -C corrupt one &&
163163
echo a >corrupt/.git/refs/heads/topic &&

0 commit comments

Comments
 (0)