Thread (27 messages) flat view 27 messages, 1 author, 2016-06-15
DORMANTno replies

[WIP PATCH 14/26] Do not try to read $GIT_DIR/info/attributes if there is no repository

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 22:48:17
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help