diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2015-06-12 17:49:24 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-12 15:21:44 -0700 |
commit | e1c1ab9d25864e8de0009f3f3149ec4386a14bf8 (patch) | |
tree | 177fac85096a1693a29b6478416e38221de4a8fb /t | |
parent | prune --worktrees: fix expire vs worktree existence condition (diff) | |
download | tgif-e1c1ab9d25864e8de0009f3f3149ec4386a14bf8.tar.xz |
checkout: don't check worktrees when not necessary
When --patch or pathspecs are passed to git checkout, the working tree
will not be switching branch, so there's no need to check if the branch
that we are running checkout on is already checked out.
Original-patch-by: Spencer Baugh <sbaugh@catern.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t2025-checkout-to.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh index f8e4df4818..a8d93366f6 100755 --- a/t/t2025-checkout-to.sh +++ b/t/t2025-checkout-to.sh @@ -28,6 +28,14 @@ test_expect_success 'checkout --to refuses to checkout locked branch' ' ! test -d .git/worktrees/zere ' +test_expect_success 'checking out paths not complaining about linked checkouts' ' + ( + cd existing_empty && + echo dirty >>init.t && + git checkout master -- init.t + ) +' + test_expect_success 'checkout --to a new worktree' ' git rev-parse HEAD >expect && git checkout --detach --to here master && |