Code

rehabilitate some t5302 tests on 32-bit off_t machines
[git.git] / dir.c
diff --git a/dir.c b/dir.c
index 5bcc764c97dca5e584d0a4227bfb299efb5699ce..fa9f9021eafef09ddeaf61f21d577b7c53fa346a 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -298,7 +298,8 @@ int excluded(struct dir_struct *dir, const char *pathname)
        return 0;
 }
 
-static struct dir_entry *dir_entry_new(const char *pathname, int len) {
+static struct dir_entry *dir_entry_new(const char *pathname, int len)
+{
        struct dir_entry *ent;
 
        ent = xmalloc(sizeof(*ent) + len + 1);
@@ -777,3 +778,15 @@ int remove_dir_recursively(struct strbuf *path, int only_empty)
                ret = rmdir(path->buf);
        return ret;
 }
+
+void setup_standard_excludes(struct dir_struct *dir)
+{
+       const char *path;
+
+       dir->exclude_per_dir = ".gitignore";
+       path = git_path("info/exclude");
+       if (!access(path, R_OK))
+               add_excludes_from_file(dir, path);
+       if (excludes_file && !access(excludes_file, R_OK))
+               add_excludes_from_file(dir, excludes_file);
+}