Merge branch 'nd/worktree-add-lock'
Allow to lock a worktree immediately after it's created. This helps prevent a race between "git worktree add; git worktree lock" and "git worktree prune". * nd/worktree-add-lock: worktree add: add --lock option
This commit is contained in:
@ -63,6 +63,12 @@ test_expect_success '"add" worktree' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success '"add" worktree with lock' '
|
||||
git rev-parse HEAD >expect &&
|
||||
git worktree add --detach --lock here-with-lock master &&
|
||||
test -f .git/worktrees/here-with-lock/locked
|
||||
'
|
||||
|
||||
test_expect_success '"add" worktree from a subdir' '
|
||||
(
|
||||
mkdir sub &&
|
||||
|
Reference in New Issue
Block a user