Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-07 23:38:17 +0300
committerJunio C Hamano <gitster@pobox.com>2015-10-07 23:38:17 +0300
commit506d8f1b394917c345965fc1762afa66678870c1 (patch)
tree6ff88fa3da3500254ac3b364fbf99bb95ddb5247 /t/t3001-ls-files-others-exclude.sh
parent2b72dbbcf3a1d6c6813db2c13afaa1d0d8585f7b (diff)
parent57534ee77d22e725d971ee89c77dc6aad61c573f (diff)
Merge branch 'nd/ignore-then-not-ignore'
Allow a later "!/abc/def" to override an earlier "/abc" that appears in the same .gitignore file to make it easier to express "everything in /abc directory is ignored, except for ...". * nd/ignore-then-not-ignore: dir.c: don't exclude whole dir prematurely if neg pattern may match dir.c: make last_exclude_matching_from_list() run til the end
Diffstat (limited to 't/t3001-ls-files-others-exclude.sh')
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index 3fc484e8c3..da257c020f 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -305,4 +305,29 @@ test_expect_success 'ls-files with "**" patterns and no slashes' '
test_cmp expect actual
'
+test_expect_success 'negative patterns' '
+ git init reinclude &&
+ (
+ cd reinclude &&
+ cat >.gitignore <<-\EOF &&
+ /fooo
+ /foo
+ !foo/bar/bar
+ EOF
+ mkdir fooo &&
+ cat >fooo/.gitignore <<-\EOF &&
+ !/*
+ EOF
+ mkdir -p foo/bar &&
+ touch abc foo/def foo/bar/ghi foo/bar/bar &&
+ git ls-files -o --exclude-standard >../actual &&
+ cat >../expected <<-\EOF &&
+ .gitignore
+ abc
+ foo/bar/bar
+ EOF
+ test_cmp ../expected ../actual
+ )
+'
+
test_done