@@ -42,8 +42,8 @@ test_expect_success '"add" using - shorthand' '
42
42
43
43
test_expect_success ' "add" refuses to checkout locked branch' '
44
44
test_must_fail git worktree add zere main &&
45
- ! test -d zere &&
46
- ! test -d .git/worktrees/zere
45
+ test_path_is_missing zere &&
46
+ test_path_is_missing .git/worktrees/zere
47
47
'
48
48
49
49
test_expect_success ' checking out paths not complaining about linked checkouts' '
@@ -70,14 +70,14 @@ test_expect_success '"add" worktree' '
70
70
test_expect_success ' "add" worktree with lock' '
71
71
git worktree add --detach --lock here-with-lock main &&
72
72
test_when_finished "git worktree unlock here-with-lock || :" &&
73
- test -f .git/worktrees/here-with-lock/locked
73
+ test_path_is_file .git/worktrees/here-with-lock/locked
74
74
'
75
75
76
76
test_expect_success ' "add" worktree with lock and reason' '
77
77
lock_reason="why not" &&
78
78
git worktree add --detach --lock --reason "$lock_reason" here-with-lock-reason main &&
79
79
test_when_finished "git worktree unlock here-with-lock-reason || :" &&
80
- test -f .git/worktrees/here-with-lock-reason/locked &&
80
+ test_path_is_file .git/worktrees/here-with-lock-reason/locked &&
81
81
echo "$lock_reason" >expect &&
82
82
test_cmp expect .git/worktrees/here-with-lock-reason/locked
83
83
'
@@ -412,14 +412,14 @@ test_expect_success '"add --orphan" with empty repository' '
412
412
test_expect_success ' "add" worktree with orphan branch and lock' '
413
413
git worktree add --lock --orphan -b orphanbr orphan-with-lock &&
414
414
test_when_finished "git worktree unlock orphan-with-lock || :" &&
415
- test -f .git/worktrees/orphan-with-lock/locked
415
+ test_path_is_file .git/worktrees/orphan-with-lock/locked
416
416
'
417
417
418
418
test_expect_success ' "add" worktree with orphan branch, lock, and reason' '
419
419
lock_reason="why not" &&
420
420
git worktree add --detach --lock --reason "$lock_reason" orphan-with-lock-reason main &&
421
421
test_when_finished "git worktree unlock orphan-with-lock-reason || :" &&
422
- test -f .git/worktrees/orphan-with-lock-reason/locked &&
422
+ test_path_is_file .git/worktrees/orphan-with-lock-reason/locked &&
423
423
echo "$lock_reason" >expect &&
424
424
test_cmp expect .git/worktrees/orphan-with-lock-reason/locked
425
425
'
@@ -474,7 +474,7 @@ test_expect_success 'local clone --shared from linked checkout' '
474
474
475
475
test_expect_success ' "add" worktree with --no-checkout' '
476
476
git worktree add --no-checkout -b swamp swamp &&
477
- ! test -e swamp/init.t &&
477
+ test_path_is_missing swamp/init.t &&
478
478
git -C swamp reset --hard &&
479
479
test_cmp init.t swamp/init.t
480
480
'
@@ -497,7 +497,7 @@ test_expect_success 'put a worktree under rebase' '
497
497
498
498
test_expect_success ' add a worktree, checking out a rebased branch' '
499
499
test_must_fail git worktree add new-rebase under-rebase &&
500
- ! test -d new-rebase
500
+ test_path_is_missing new-rebase
501
501
'
502
502
503
503
test_expect_success ' checking out a rebased branch from another worktree' '
@@ -535,7 +535,7 @@ test_expect_success 'checkout a branch under bisect' '
535
535
git worktree list >actual &&
536
536
grep "under-bisect.*detached HEAD" actual &&
537
537
test_must_fail git worktree add new-bisect under-bisect &&
538
- ! test -d new-bisect
538
+ test_path_is_missing new-bisect
539
539
)
540
540
'
541
541
@@ -1165,7 +1165,7 @@ test_expect_success '"add" not tripped up by magic worktree matching"' '
1165
1165
1166
1166
test_expect_success FUNNYNAMES ' sanitize generated worktree name' '
1167
1167
git worktree add --detach ". weird*..?.lock.lock" &&
1168
- test -d .git/worktrees/---weird-.-
1168
+ test_path_is_dir .git/worktrees/---weird-.-
1169
1169
'
1170
1170
1171
1171
test_expect_success ' "add" should not fail because of another bad worktree' '
0 commit comments