git_extract_argv0_path: do nothing without RUNTIME_PREFIX
[gitweb.git] / attr.c
diff --git a/attr.c b/attr.c
index 6537a433da201e866208ab23bf32bcafee037683..1fcf042b87c8a39fb967e07c5acb81c0c364d136 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -122,7 +122,7 @@ struct pattern {
        const char *pattern;
        int patternlen;
        int nowildcardlen;
-       int flags;              /* EXC_FLAG_* */
+       unsigned flags;         /* EXC_FLAG_* */
 };
 
 /*
@@ -531,7 +531,11 @@ static void bootstrap_attr_stack(void)
                debug_push(elem);
        }
 
-       elem = read_attr_from_file(git_path_info_attributes(), 1);
+       if (startup_info->have_repository)
+               elem = read_attr_from_file(git_path_info_attributes(), 1);
+       else
+               elem = NULL;
+
        if (!elem)
                elem = xcalloc(1, sizeof(*elem));
        elem->origin = NULL;