[WIP PATCH 14/26] Do not try to read $GIT_DIR/info/attributes if there is no repository
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
attr.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/attr.c b/attr.c
index f5346ed..f1362de 100644
--- a/attr.c
+++ b/attr.c
@@ -480,7 +480,10 @@ static void bootstrap_attr_stack(void)
debug_push(elem);
}
- elem = read_attr_from_file(git_path(INFOATTRIBUTES_FILE), 1);
+ if (!startup_info || startup_info->have_repository)
+ elem = read_attr_from_file(git_path(INFOATTRIBUTES_FILE), 1);
+ else
+ elem = NULL;
if (!elem)
elem = xcalloc(1, sizeof(*elem));
elem->origin = NULL;
--
1.7.0.195.g637a2