From: Jeff King Date: Wed, 25 Nov 2009 22:46:16 +0000 (-0500) Subject: tests: rename duplicate t1009 X-Git-Tag: v1.7.0-rc0~103^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bbbe508d771f6a4c65fea43343597ecfa1eb540e;p=git.git tests: rename duplicate t1009 We should avoid duplicate test numbers, since things like GIT_SKIP_TESTS consider something like t1009.5 to be unambiguous. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/t/t1009-read-tree-sparse-checkout.sh b/t/t1009-read-tree-sparse-checkout.sh deleted file mode 100755 index 62246dbf9..000000000 --- a/t/t1009-read-tree-sparse-checkout.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh - -test_description='sparse checkout tests' - -. ./test-lib.sh - -cat >expected <> init.t && - mkdir sub && - touch sub/added && - git add init.t sub/added && - git commit -m "modified and added" && - git tag top && - git rm sub/added && - git commit -m removed && - git tag removed && - git checkout top && - git ls-files --stage > result && - test_cmp expected result -' - -cat >expected.swt < result && - test_cmp expected result && - git ls-files -t > result && - test_cmp expected.swt result -' - -test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' ' - echo > .git/info/sparse-checkout - git read-tree -m -u HEAD && - git ls-files -t > result && - test_cmp expected.swt result && - test -f init.t && - test -f sub/added -' - -test_expect_success 'read-tree --no-sparse-checkout with empty .git/info/sparse-checkout and enabled' ' - git config core.sparsecheckout true && - echo > .git/info/sparse-checkout && - git read-tree --no-sparse-checkout -m -u HEAD && - git ls-files -t > result && - test_cmp expected.swt result && - test -f init.t && - test -f sub/added -' - -test_expect_success 'read-tree with empty .git/info/sparse-checkout' ' - git config core.sparsecheckout true && - echo > .git/info/sparse-checkout && - test_must_fail git read-tree -m -u HEAD && - git ls-files --stage > result && - test_cmp expected result && - git ls-files -t > result && - test_cmp expected.swt result && - test -f init.t && - test -f sub/added -' - -cat >expected.swt < .git/info/sparse-checkout && - git read-tree -m -u HEAD && - git ls-files -t > result && - test_cmp expected.swt result && - test ! -f init.t && - test -f sub/added -' - -cat >expected.swt < .git/info/sparse-checkout && - echo sub >> .git/info/sparse-checkout && - git read-tree -m -u HEAD && - git ls-files -t > result && - test_cmp expected.swt result && - test ! -f init.t && - test -f sub/added -' - -cat >expected.swt < .git/info/sparse-checkout && - git read-tree -m -u HEAD && - git ls-files -t > result && - test_cmp expected.swt result && - test -f init.t && - test ! -f sub/added -' - -test_expect_success 'read-tree updates worktree, absent case' ' - echo sub/added > .git/info/sparse-checkout && - git checkout -f top && - git read-tree -m -u HEAD^ && - test ! -f init.t -' - -test_expect_success 'read-tree updates worktree, dirty case' ' - echo sub/added > .git/info/sparse-checkout && - git checkout -f top && - echo dirty > init.t && - git read-tree -m -u HEAD^ && - grep -q dirty init.t && - rm init.t -' - -test_expect_success 'read-tree removes worktree, dirty case' ' - echo init.t > .git/info/sparse-checkout && - git checkout -f top && - echo dirty > added && - git read-tree -m -u HEAD^ && - grep -q dirty added -' - -test_expect_success 'read-tree adds to worktree, absent case' ' - echo init.t > .git/info/sparse-checkout && - git checkout -f removed && - git read-tree -u -m HEAD^ && - test ! -f sub/added -' - -test_expect_success 'read-tree adds to worktree, dirty case' ' - echo init.t > .git/info/sparse-checkout && - git checkout -f removed && - mkdir sub && - echo dirty > sub/added && - git read-tree -u -m HEAD^ && - grep -q dirty sub/added -' - -test_done diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh new file mode 100755 index 000000000..62246dbf9 --- /dev/null +++ b/t/t1011-read-tree-sparse-checkout.sh @@ -0,0 +1,150 @@ +#!/bin/sh + +test_description='sparse checkout tests' + +. ./test-lib.sh + +cat >expected <> init.t && + mkdir sub && + touch sub/added && + git add init.t sub/added && + git commit -m "modified and added" && + git tag top && + git rm sub/added && + git commit -m removed && + git tag removed && + git checkout top && + git ls-files --stage > result && + test_cmp expected result +' + +cat >expected.swt < result && + test_cmp expected result && + git ls-files -t > result && + test_cmp expected.swt result +' + +test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' ' + echo > .git/info/sparse-checkout + git read-tree -m -u HEAD && + git ls-files -t > result && + test_cmp expected.swt result && + test -f init.t && + test -f sub/added +' + +test_expect_success 'read-tree --no-sparse-checkout with empty .git/info/sparse-checkout and enabled' ' + git config core.sparsecheckout true && + echo > .git/info/sparse-checkout && + git read-tree --no-sparse-checkout -m -u HEAD && + git ls-files -t > result && + test_cmp expected.swt result && + test -f init.t && + test -f sub/added +' + +test_expect_success 'read-tree with empty .git/info/sparse-checkout' ' + git config core.sparsecheckout true && + echo > .git/info/sparse-checkout && + test_must_fail git read-tree -m -u HEAD && + git ls-files --stage > result && + test_cmp expected result && + git ls-files -t > result && + test_cmp expected.swt result && + test -f init.t && + test -f sub/added +' + +cat >expected.swt < .git/info/sparse-checkout && + git read-tree -m -u HEAD && + git ls-files -t > result && + test_cmp expected.swt result && + test ! -f init.t && + test -f sub/added +' + +cat >expected.swt < .git/info/sparse-checkout && + echo sub >> .git/info/sparse-checkout && + git read-tree -m -u HEAD && + git ls-files -t > result && + test_cmp expected.swt result && + test ! -f init.t && + test -f sub/added +' + +cat >expected.swt < .git/info/sparse-checkout && + git read-tree -m -u HEAD && + git ls-files -t > result && + test_cmp expected.swt result && + test -f init.t && + test ! -f sub/added +' + +test_expect_success 'read-tree updates worktree, absent case' ' + echo sub/added > .git/info/sparse-checkout && + git checkout -f top && + git read-tree -m -u HEAD^ && + test ! -f init.t +' + +test_expect_success 'read-tree updates worktree, dirty case' ' + echo sub/added > .git/info/sparse-checkout && + git checkout -f top && + echo dirty > init.t && + git read-tree -m -u HEAD^ && + grep -q dirty init.t && + rm init.t +' + +test_expect_success 'read-tree removes worktree, dirty case' ' + echo init.t > .git/info/sparse-checkout && + git checkout -f top && + echo dirty > added && + git read-tree -m -u HEAD^ && + grep -q dirty added +' + +test_expect_success 'read-tree adds to worktree, absent case' ' + echo init.t > .git/info/sparse-checkout && + git checkout -f removed && + git read-tree -u -m HEAD^ && + test ! -f sub/added +' + +test_expect_success 'read-tree adds to worktree, dirty case' ' + echo init.t > .git/info/sparse-checkout && + git checkout -f removed && + mkdir sub && + echo dirty > sub/added && + git read-tree -u -m HEAD^ && + grep -q dirty sub/added +' + +test_done