checkout: clean up half-prepared directories in --to mode
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5883034c61
commit
3b8925c78b
@ -17,6 +17,12 @@ test_expect_success 'checkout --to an existing worktree' '
|
||||
test_must_fail git checkout --detach --to existing master
|
||||
'
|
||||
|
||||
test_expect_success 'checkout --to refuses to checkout locked branch' '
|
||||
test_must_fail git checkout --to zere master &&
|
||||
! test -d zere &&
|
||||
! test -d .git/worktrees/zere
|
||||
'
|
||||
|
||||
test_expect_success 'checkout --to a new worktree' '
|
||||
git rev-parse HEAD >expect &&
|
||||
git checkout --detach --to here master &&
|
||||
|
Reference in New Issue
Block a user