Skip to content

Commit f0de108

Browse files
john-caigitster
authored andcommitted
t1415: move reffiles specific tests to t0601
Move this test into t0601 with other reffiles pack-refs specific tests since it checks for individual loose refs and thus is specific to the reffiles backend. Signed-off-by: John Cai <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c02ce75 commit f0de108

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

t/t0601-reffiles-pack-refs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,24 @@ test_expect_success SYMLINKS 'pack symlinked packed-refs' '
308308
test "$(test_readlink .git/packed-refs)" = "my-deviant-packed-refs"
309309
'
310310

311+
# The 'packed-refs' file is stored directly in .git/. This means it is global
312+
# to the repository, and can only contain refs that are shared across all
313+
# worktrees.
314+
test_expect_success 'refs/worktree must not be packed' '
315+
test_commit initial &&
316+
test_commit wt1 &&
317+
test_commit wt2 &&
318+
git worktree add wt1 wt1 &&
319+
git worktree add wt2 wt2 &&
320+
git checkout initial &&
321+
git update-ref refs/worktree/foo HEAD &&
322+
git -C wt1 update-ref refs/worktree/foo HEAD &&
323+
git -C wt2 update-ref refs/worktree/foo HEAD &&
324+
git pack-refs --all &&
325+
test_path_is_missing .git/refs/tags/wt1 &&
326+
test_path_is_file .git/refs/worktree/foo &&
327+
test_path_is_file .git/worktrees/wt1/refs/worktree/foo &&
328+
test_path_is_file .git/worktrees/wt2/refs/worktree/foo
329+
'
330+
311331
test_done

t/t1415-worktree-refs.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ test_expect_success 'setup' '
1717
git -C wt2 update-ref refs/worktree/foo HEAD
1818
'
1919

20-
# The 'packed-refs' file is stored directly in .git/. This means it is global
21-
# to the repository, and can only contain refs that are shared across all
22-
# worktrees.
23-
test_expect_success REFFILES 'refs/worktree must not be packed' '
24-
git pack-refs --all &&
25-
test_path_is_missing .git/refs/tags/wt1 &&
26-
test_path_is_file .git/refs/worktree/foo &&
27-
test_path_is_file .git/worktrees/wt1/refs/worktree/foo &&
28-
test_path_is_file .git/worktrees/wt2/refs/worktree/foo
29-
'
30-
3120
test_expect_success 'refs/worktree are per-worktree' '
3221
test_cmp_rev worktree/foo initial &&
3322
( cd wt1 && test_cmp_rev worktree/foo wt1 ) &&

0 commit comments

Comments
 (0)