Skip to content

Commit 32738ed

Browse files
Michael J Grubergitster
authored andcommitted
test overlapping ignore patterns
Add a test which checks that negated patterns such as "!foo.html" can override previous patterns such as "*.html". This is documented behaviour but had not been tested so far. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c0ceb2c commit 32738ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

t/t3001-ls-files-others-exclude.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,10 @@ test_expect_success 'trailing slash in exclude forces directory match (2)' '
140140
141141
'
142142

143+
test_expect_success 'negated exclude matches can override previous ones' '
144+
145+
git ls-files --others --exclude="a.*" --exclude="!a.1" >output &&
146+
grep "^a.1" output
147+
'
148+
143149
test_done

0 commit comments

Comments
 (0)