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 <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Cai committed
Jan 19, 2024 at 20:18 UTC
f0de10841743afebc629aaf25388f329fb47f4a9
2 files changed
+20
-11
t/t0601-reffiles-pack-refs.sh
+20
@@ -308,4 +308,24 @@ test_expect_success SYMLINKS 'pack symlinked packed-refs' '
308
test "$(test_readlink .git/packed-refs)" = "my-deviant-packed-refs"
309
'
310
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
+
331
test_done
t/t1415-worktree-refs.sh
-11
@@ -17,17 +17,6 @@ test_expect_success 'setup' '
17
git -C wt2 update-ref refs/worktree/foo HEAD
18
'
19
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
-
20
test_expect_success 'refs/worktree are per-worktree' '
21
test_cmp_rev worktree/foo initial &&
22
( cd wt1 && test_cmp_rev worktree/foo wt1 ) &&