summaryrefslogtreecommitdiff
path: root/t/t2025-worktree-add.sh
diff options
context:
space:
mode:
authorRay Zhang <zhanglei002@gmail.com>2016-03-29 10:11:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-29 18:12:36 (GMT)
commitef2a0ac9a00c5d82f1fbbef8304c662ff60e4235 (patch)
tree214728c298d16cd1e4c00c27dde514d9bb86fd5d /t/t2025-worktree-add.sh
parent56331f8727b0c2e7dc713b728eaf1e5843422cb7 (diff)
downloadgit-ef2a0ac9a00c5d82f1fbbef8304c662ff60e4235.zip
git-ef2a0ac9a00c5d82f1fbbef8304c662ff60e4235.tar.gz
git-ef2a0ac9a00c5d82f1fbbef8304c662ff60e4235.tar.bz2
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/t2025-worktree-add.sh')
-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 cbfa41e..3acb992 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