]> git.ipfire.org Git - thirdparty/git.git/commit
dir.c: do not be fooled by :(exclude) pathspec elements
authorJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2025 22:11:20 +0000 (14:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2025 22:12:24 +0000 (14:12 -0800)
commit97660b2cfedeee452db8e852d6d476e333ac971d
treef3ce2b7a798d73f814278379fda1a7987a4f0971
parenta1cf0cf13ab3a659ac77b7d749d6e5b11dc0142b
dir.c: do not be fooled by :(exclude) pathspec elements

When exclude_matches_pathspec() tries to determine if an otherwise
excluded item matches the pathspec given, it goes through each
pathspec element and declares a hit, without checking if the element
is a negative ":(exclude)" element.  Fix it be applying the usual "a
path matches if it matches any one of positive pathspec element, and
if it matches none of negative pathspec elements" rule in the
function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
t/t2204-add-ignored.sh