{"thread":{"id":"14625","subject":"[PATCH 11/12] tests for checkout [--full|--path]","startedAt":"2008-07-23T14:57:59Z","lastAt":"2008-07-23T14:57:59Z","messageCount":1,"participants":["Nguyễn Thái Ngọc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":12},"messages":[{"id":"84514","messageId":"20080723145759.GA29166@laptop","threadId":"14625","inReplyTo":null,"subject":"[PATCH 11/12] tests for checkout [--full|--path]","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-07-23T14:57:59Z","receivedAt":"2008-07-23T14:57:59Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t2010-checkout-sparse.sh |   71 ++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 71 insertions(+), 0 deletions(-)\n create mode 100755 t/t2010-checkout-sparse.sh\n\ndiff --git a/t/t2010-checkout-sparse.sh b/t/t2010-checkout-sparse.sh\nnew file mode 100755\nindex 0000000..5bb82ae\n--- /dev/null\n+++ b/t/t2010-checkout-sparse.sh\n@@ -0,0 +1,71 @@\n+#!/bin/sh\n+\n+test_description='sparse checkout'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\tmkdir work1 work2 work3\n+\ttouch one two three\n+\ttouch work1/one work2/two work3/three\n+\tgit add one work1/one\n+\tgit commit -m work1\n+\tgit add two work2/two\n+\tgit commit -m work2\n+\tgit add three work3/three\n+\tgit commit -m work3\n+'\n+\n+test_expect_success '--full on no-sparse checkout' '\n+\tgit checkout --full\n+'\n+\n+test_expect_success '--full and --path incompatible' '\n+\ttest_must_fail git checkout --full --path=work1\n+'\n+\n+test_expect_success 'limit worktree to work1 and work2' '\n+\tgit checkout --path=work1:work2 &&\n+\ttest work1:work2 = \"$(git rev-parse --show-sparse-prefix)\" &&\n+\ttest -f work1/one &&\n+\ttest -f work2/two &&\n+\t! test -f work3/three\n+'\n+\n+test_expect_success 'update worktree to work2 and work3' '\n+\tgit checkout --path=work2:work3 &&\n+\ttest work2:work3 = \"$(git rev-parse --show-sparse-prefix)\" &&\n+\t! test -f work1/one &&\n+\ttest -f work2/two &&\n+\ttest -f work3/three\n+'\n+\n+test_expect_success 'update sparse prefix with modification' '\n+\techo modified >> work2/two &&\n+\tgit checkout --path=work1:work2 &&\n+\ttest work1:work2 = \"$(git rev-parse --show-sparse-prefix)\" &&\n+\ttest -f work1/one &&\n+\ttest -f work2/two &&\n+\t! test -f work3/three &&\n+\tgrep -q modified work2/two\n+'\n+\n+test_expect_success 'update sparse should not lose modification' '\n+\t! git checkout --path=work1:work3 &&\n+\ttest work1:work2 = \"$(git rev-parse --show-sparse-prefix)\" &&\n+\ttest -f work1/one &&\n+\ttest -f work2/two &&\n+\t! test -f work3/three &&\n+\tgrep -q modified work2/two\n+'\n+\n+test_expect_success 'exit sparse checkout' '\n+\tgit checkout --full &&\n+\ttest -z \"$(git rev-parse --show-sparse-prefix)\" &&\n+\ttest -f work1/one &&\n+\ttest -f work2/two &&\n+\ttest -f work3/three &&\n+\ttest one\n+'\n+\n+test_done\n-- \n1.5.5.GIT\n"}]}