summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Ray Zhang <zhanglei002@gmail.com>2016-03-29 10:11:01 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-03-29 11:12:36 -0700
commitef2a0ac9a00c5d82f1fbbef8304c662ff60e4235 (patch)
tree214728c298d16cd1e4c00c27dde514d9bb86fd5d /t
parentMerge branch 'ls/p4-doc-markup' (diff)
downloadtgif-ef2a0ac9a00c5d82f1fbbef8304c662ff60e4235.tar.xz
worktree: add: introduce --checkout option
By adding this option which defaults to true, we can use the corresponding --no-checkout to make some customizations before the checkout, like sparse checkout, etc. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Junio C Hamano <gitster@pobox.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Ray Zhang <zhanglei002@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t2025-worktree-add.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh
index cbfa41ec61..3acb9926f2 100755
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -213,4 +213,16 @@ test_expect_success 'local clone from linked checkout' '
( cd here-clone && git fsck )
'
+test_expect_success '"add" worktree with --no-checkout' '
+ git worktree add --no-checkout -b swamp swamp &&
+ ! test -e swamp/init.t &&
+ git -C swamp reset --hard &&
+ test_cmp init.t swamp/init.t
+'
+
+test_expect_success '"add" worktree with --checkout' '
+ git worktree add --checkout -b swmap2 swamp2 &&
+ test_cmp init.t swamp2/init.t
+'
+
test_done