Merge branch 'ms/daemon-doc-typo'
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 0015cc54f455cf48e6e2d66c23ecebfa017fcf00..a772c6dc6c2bf4dc40f46f0bb5d0899312f3ffd4 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1303,12 +1303,17 @@ int remove_dir_recursively(struct strbuf *path, int flag)
 void setup_standard_excludes(struct dir_struct *dir)
 {
        const char *path;
+       char *xdg_path;
 
        dir->exclude_per_dir = ".gitignore";
        path = git_path("info/exclude");
+       if (!excludes_file) {
+               home_config_paths(NULL, &xdg_path, "ignore");
+               excludes_file = xdg_path;
+       }
        if (!access(path, R_OK))
                add_excludes_from_file(dir, path);
-       if (excludes_file && !access(excludes_file, R_OK))
+       if (!access(excludes_file, R_OK))
                add_excludes_from_file(dir, excludes_file);
 }