[WIP PATCH 11/26] Do not look for .git/info/exclude when gitdir is not set up
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
dir.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dir.c b/dir.c
index 67c3af6..a8fcbce 100644
--- a/dir.c
+++ b/dir.c
@@ -1024,9 +1024,11 @@ 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 (!startup_info || startup_info->have_repository) {
+ 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);
}
--
1.7.0.195.g637a2