summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-add.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-add.c b/builtin-add.c
index 7345479..de5c108 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,
path = git_path("info/exclude");
if (!access(path, R_OK))
add_excludes_from_file(dir, path);
- if (!access(excludes_file, R_OK))
+ if (excludes_file != NULL && !access(excludes_file, R_OK))
add_excludes_from_file(dir, excludes_file);
}