summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 08:24:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:00:17 (GMT)
commit3b8925c78bdbea49c846e350e66c13923441fff8 (patch)
tree7059b1c0fd97b4b32319ad1c8239ca012a76232d /t
parent5883034c61c60e04db16520a759ec67a34ffaea3 (diff)
downloadgit-3b8925c78bdbea49c846e350e66c13923441fff8.zip
git-3b8925c78bdbea49c846e350e66c13923441fff8.tar.gz
git-3b8925c78bdbea49c846e350e66c13923441fff8.tar.bz2
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t2025-checkout-to.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh
index edd3404..e2db078 100755
--- a/t/t2025-checkout-to.sh
+++ b/t/t2025-checkout-to.sh
@@ -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 &&