clear parsed flag when we free tree buffers
[gitweb.git] / dir.h
diff --git a/dir.h b/dir.h
index dd42a3a0614b10c1f522321db9c3a638cadbceac..3d6b80c933b395644c005f6d8df4697215ff000a 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -79,7 +79,8 @@ struct dir_struct {
                DIR_SHOW_OTHER_DIRECTORIES = 1<<1,
                DIR_HIDE_EMPTY_DIRECTORIES = 1<<2,
                DIR_NO_GITLINKS = 1<<3,
-               DIR_COLLECT_IGNORED = 1<<4
+               DIR_COLLECT_IGNORED = 1<<4,
+               DIR_SHOW_IGNORED_TOO = 1<<5
        } flags;
        struct dir_entry **entries;
        struct dir_entry **ignored;
@@ -110,12 +111,20 @@ struct dir_struct {
         *
         * exclude_stack points to the top of the exclude_stack, and
         * basebuf contains the full path to the current
-        * (sub)directory in the traversal.
+        * (sub)directory in the traversal. Exclude points to the
+        * matching exclude struct if the directory is excluded.
         */
        struct exclude_stack *exclude_stack;
+       struct exclude *exclude;
        char basebuf[PATH_MAX];
 };
 
+/*
+ * The ordering of these constants is significant, with
+ * higher-numbered match types signifying "closer" (i.e. more
+ * specific) matches which will override lower-numbered match types
+ * when populating the seen[] array.
+ */
 #define MATCHED_RECURSIVELY 1
 #define MATCHED_FNMATCH 2
 #define MATCHED_EXACTLY 3
@@ -143,22 +152,10 @@ extern int match_pathname(const char *, int,
                          const char *, int,
                          const char *, int, int, int);
 
-/*
- * The is_excluded() API is meant for callers that check each level of leading
- * directory hierarchies with is_excluded() to avoid recursing into excluded
- * directories.  Callers that do not do so should use this API instead.
- */
-struct path_exclude_check {
-       struct dir_struct *dir;
-       struct exclude *exclude;
-       struct strbuf path;
-};
-extern void path_exclude_check_init(struct path_exclude_check *, struct dir_struct *);
-extern void path_exclude_check_clear(struct path_exclude_check *);
-extern struct exclude *last_exclude_matching_path(struct path_exclude_check *, const char *,
-                                                 int namelen, int *dtype);
-extern int is_path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype);
+extern struct exclude *last_exclude_matching(struct dir_struct *dir,
+                                            const char *name, int *dtype);
 
+extern int is_excluded(struct dir_struct *dir, const char *name, int *dtype);
 
 extern struct exclude_list *add_exclude_list(struct dir_struct *dir,
                                             int group_type, const char *src);
@@ -198,4 +195,13 @@ extern int strcmp_icase(const char *a, const char *b);
 extern int strncmp_icase(const char *a, const char *b, size_t count);
 extern int fnmatch_icase(const char *pattern, const char *string, int flags);
 
+/*
+ * The prefix part of pattern must not contains wildcards.
+ */
+#define GFNM_PATHNAME 1                /* similar to FNM_PATHNAME */
+#define GFNM_ONESTAR  2                /* there is only _one_ wildcard, a star */
+
+extern int git_fnmatch(const char *pattern, const char *string,
+                      int flags, int prefix);
+
 #endif