Merge branch 'rs/unpack-trees-plug-leak'
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index ee4d04dc8b378dab223ea8a8589dca7a58eeea48..897c87403e978ab2123ce088cf2d3265e21d7dde 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;