summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-02 23:07:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-02 23:07:18 (GMT)
commitcb2f5a8e971bdc4d08dde91c8f16a7464ef94cd8 (patch)
tree8e31d0e4490723e3466d48bf9c6ce9dcb461ee12 /builtin
parent0df82d99dae85dbd4f667e95020a146ea0167975 (diff)
parent7ec8125fba96f47b00bb0cab3ed716557e81e7e6 (diff)
downloadgit-cb2f5a8e971bdc4d08dde91c8f16a7464ef94cd8.zip
git-cb2f5a8e971bdc4d08dde91c8f16a7464ef94cd8.tar.gz
git-cb2f5a8e971bdc4d08dde91c8f16a7464ef94cd8.tar.bz2
Merge branch 'en/check-ignore'
"git check-ignore" did not work when the given path is explicitly marked as not ignored with a negative entry in the .gitignore file. * en/check-ignore: check-ignore: fix documentation and implementation to match
Diffstat (limited to 'builtin')
-rw-r--r--builtin/check-ignore.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index 5a4f923..ea5d0ae 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -108,6 +108,9 @@ static int check_ignore(struct dir_struct *dir,
int dtype = DT_UNKNOWN;
pattern = last_matching_pattern(dir, &the_index,
full_path, &dtype);
+ if (!verbose && pattern &&
+ pattern->flags & PATTERN_FLAG_NEGATIVE)
+ pattern = NULL;
}
if (!quiet && (pattern || show_non_matching))
output_pattern(pathspec.items[i].original, pattern);