Git 2.23
[gitweb.git] / builtin / check-ignore.c
index c7b8c08897193e225d8da32f4d402def3f16fe50..599097304b77fa5a3f464b8831e71d6a3f56077a 100644 (file)
@@ -1,5 +1,7 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "builtin.h"
 #include "cache.h"
+#include "config.h"
 #include "dir.h"
 #include "quote.h"
 #include "pathspec.h"
@@ -71,7 +73,7 @@ static int check_ignore(struct dir_struct *dir,
 {
        const char *full_path;
        char *seen;
-       int num_ignored = 0, dtype = DT_UNKNOWN, i;
+       int num_ignored = 0, i;
        struct exclude *exclude;
        struct pathspec pathspec;
 
@@ -103,6 +105,7 @@ static int check_ignore(struct dir_struct *dir,
                full_path = pathspec.items[i].match;
                exclude = NULL;
                if (!seen[i]) {
+                       int dtype = DT_UNKNOWN;
                        exclude = last_exclude_matching(dir, &the_index,
                                                        full_path, &dtype);
                }