From d61ebbe8f57107afe1b04005be420117d3806675 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 2 May 2011 19:47:43 +0700 Subject: [PATCH] t1011: fix sparse-checkout initialization and add new file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Do not append to $GIT_DIR/info/sparse-checkout at each test, overwrite it instead. Also add sub/addedtoo for more complex tests later on Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t1011-read-tree-sparse-checkout.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh index de84e35c4..3f9d66f0b 100755 --- a/t/t1011-read-tree-sparse-checkout.sh +++ b/t/t1011-read-tree-sparse-checkout.sh @@ -17,19 +17,21 @@ test_expect_success 'setup' ' cat >expected <<-\EOF && 100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0 init.t 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 sub/added + 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 sub/addedtoo 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 subsub/added EOF cat >expected.swt <<-\EOF && H init.t H sub/added + H sub/addedtoo H subsub/added EOF test_commit init && echo modified >>init.t && mkdir sub subsub && - touch sub/added subsub/added && - git add init.t sub/added subsub/added && + touch sub/added sub/addedtoo subsub/added && + git add init.t sub/added sub/addedtoo subsub/added && git commit -m "modified and added" && git tag top && git rm sub/added && @@ -83,6 +85,7 @@ test_expect_success 'match directories with trailing slash' ' cat >expected.swt-noinit <<-\EOF && S init.t H sub/added + H sub/addedtoo S subsub/added EOF @@ -95,7 +98,7 @@ test_expect_success 'match directories with trailing slash' ' ' test_expect_success 'match directories without trailing slash' ' - echo sub >>.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-noinit result && @@ -104,7 +107,7 @@ test_expect_success 'match directories without trailing slash' ' ' test_expect_success 'match directory pattern' ' - echo "s?b" >>.git/info/sparse-checkout && + echo "s?b" >.git/info/sparse-checkout && git read-tree -m -u HEAD && git ls-files -t >result && test_cmp expected.swt-noinit result && @@ -116,6 +119,7 @@ test_expect_success 'checkout area changes' ' cat >expected.swt-nosub <<-\EOF && H init.t S sub/added + S sub/addedtoo S subsub/added EOF -- 2.26.2