Merge branch 'kb/status-ignored-optim-2' into maint
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index a5926fbd1aeafd468860da7dbd3d8a5d5999a650..13858fefa56b2d72f8ce6ce35f6bb8646f11ca81 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -821,6 +821,9 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
                                dir->basebuf, stk->baselen - 1,
                                dir->basebuf + current, &dt);
                        dir->basebuf[stk->baselen - 1] = '/';
+                       if (dir->exclude &&
+                           dir->exclude->flags & EXC_FLAG_NEGATIVE)
+                               dir->exclude = NULL;
                        if (dir->exclude) {
                                dir->basebuf[stk->baselen] = 0;
                                dir->exclude_stack = stk;