summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-02 15:07:18 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-02 15:07:18 -0800
commitcb2f5a8e971bdc4d08dde91c8f16a7464ef94cd8 (patch)
tree8e31d0e4490723e3466d48bf9c6ce9dcb461ee12 /builtin
parentMerge branch 'jk/object-filter-with-bitmap' (diff)
parentcheck-ignore: fix documentation and implementation to match (diff)
downloadtgif-cb2f5a8e971bdc4d08dde91c8f16a7464ef94cd8.tar.xz
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 5a4f92395f..ea5d0ae3a6 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);