summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e3aa87)
raw | patch | inline | side by side (parent: 4e3aa87)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Mon, 2 May 2011 12:47:43 +0000 (19:47 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 May 2011 16:03:13 +0000 (09:03 -0700) |
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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
it instead.
Also add sub/addedtoo for more complex tests later on
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1011-read-tree-sparse-checkout.sh | patch | blob | history |
index de84e35c4357c7329b3fae749228df28f31a9d3f..3f9d66f0b2b41f32038724e81aa9e086f8967d99 100755 (executable)
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 &&
cat >expected.swt-noinit <<-\EOF &&
S init.t
H sub/added
+ H sub/addedtoo
S subsub/added
EOF
'
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 &&
'
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 &&
cat >expected.swt-nosub <<-\EOF &&
H init.t
S sub/added
+ S sub/addedtoo
S subsub/added
EOF