aboutsummaryrefslogtreecommitdiff
path: root/t/t7300-clean.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-08-20 20:47:01 +0700
committerJunio C Hamano <gitster@pobox.com>2009-08-23 17:13:33 -0700
commitc28b3d6e7b0471a02f81324a90b26effae0f4bde (patch)
tree8703845ea95ac8755a183d18fd13540eb7768a1e /t/t7300-clean.sh
parentb5041c5f3b9ea70ce7aa9711af6ed6f2d02909b0 (diff)
downloadgit-c28b3d6e7b0471a02f81324a90b26effae0f4bde.tar.gz
git-c28b3d6e7b0471a02f81324a90b26effae0f4bde.tar.xz
Read .gitignore from index if it is skip-worktree
This adds index as a prerequisite for directory listing (with exclude). At the moment directory listing is used by "git clean", "git add", "git ls-files" and "git status"/"git commit" and unpack_trees()-related commands. These commands have been checked/modified to populate index before doing directory listing. add_excludes_from_file() does not enable this feature, because it is used to read .git/info/exclude and some explicit files specified by "git ls-files". Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7300-clean.sh')
-rwxr-xr-xt/t7300-clean.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 929d5d4d3..8073d02be 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -22,6 +22,25 @@ test_expect_success 'setup' '
'
+test_expect_success 'git clean with skip-worktree .gitignore' '
+ git update-index --skip-worktree .gitignore &&
+ rm .gitignore &&
+ mkdir -p build docs &&
+ touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
+ git clean &&
+ test -f Makefile &&
+ test -f README &&
+ test -f src/part1.c &&
+ test -f src/part2.c &&
+ test ! -f a.out &&
+ test ! -f src/part3.c &&
+ test -f docs/manual.txt &&
+ test -f obj.o &&
+ test -f build/lib.so &&
+ git update-index --no-skip-worktree .gitignore &&
+ git checkout .gitignore
+'
+
test_expect_success 'git clean' '
mkdir -p build docs &&