summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-09 07:07:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-09 07:11:40 (GMT)
commit472e746991db09fea7f11e4cb856c2cec9dc282b (patch)
tree65ef940566340b03762e0c7e548884ae157e3568
parentd6f8fd0b3eeb4349493209740742d67616e0263c (diff)
downloadgit-472e746991db09fea7f11e4cb856c2cec9dc282b.zip
git-472e746991db09fea7f11e4cb856c2cec9dc282b.tar.gz
git-472e746991db09fea7f11e4cb856c2cec9dc282b.tar.bz2
t3001: test ls-files -o ignored/dir
When you have "t" directory that is marked as ignored in the top-level .gitignore file (or $GIT_DIR/info/exclude), running $ git ls-files -o --exclude-standard from the top-level correctly excludes files in "t" directory, but any of the following: $ git ls-files -o --exclude-standard t/ $ cd t && git ls-files -o --exclude-standard would show untracked files in that directory. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index c65bca8..e3e4d71 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -153,4 +153,43 @@ test_expect_success 'negated exclude matches can override previous ones' '
grep "^a.1" output
'
+test_expect_success 'subdirectory ignore (setup)' '
+ mkdir -p top/l1/l2 &&
+ (
+ cd top &&
+ git init &&
+ echo /.gitignore >.gitignore &&
+ echo l1 >>.gitignore &&
+ echo l2 >l1/.gitignore &&
+ >l1/l2/l1
+ )
+'
+
+test_expect_success 'subdirectory ignore (toplevel)' '
+ (
+ cd top &&
+ git ls-files -o --exclude-standard
+ ) >actual &&
+ >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'subdirectory ignore (l1/l2)' '
+ (
+ cd top/l1/l2 &&
+ git ls-files -o --exclude-standard
+ ) >actual &&
+ >expect &&
+ test_cmp expect actual
+'
+
+test_expect_failure 'subdirectory ignore (l1)' '
+ (
+ cd top/l1 &&
+ git ls-files -o --exclude-standard
+ ) >actual &&
+ >expect &&
+ test_cmp expect actual
+'
+
test_done