memoize common git-path "constant" files
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 8209f8b8af1e1e3dbc9c166ca351b602de5e6f7a..1ac8d5dd286837893af711037f718c01d3e62f10 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1848,7 +1848,7 @@ static const char *get_ident_string(void)
 
        if (sb.len)
                return sb.buf;
-       if (uname(&uts))
+       if (uname(&uts) < 0)
                die_errno(_("failed to get kernel name and information"));
        strbuf_addf(&sb, "Location %s, system %s %s %s", get_git_work_tree(),
                    uts.sysname, uts.release, uts.version);
@@ -2185,6 +2185,8 @@ int remove_dir_recursively(struct strbuf *path, int flag)
        return remove_dir_recurse(path, flag, NULL);
 }
 
+static GIT_PATH_FUNC(git_path_info_exclude, "info/exclude")
+
 void setup_standard_excludes(struct dir_struct *dir)
 {
        const char *path;
@@ -2199,7 +2201,7 @@ void setup_standard_excludes(struct dir_struct *dir)
                                         dir->untracked ? &dir->ss_excludes_file : NULL);
 
        /* per repository user preference */
-       path = git_path("info/exclude");
+       path = git_path_info_exclude();
        if (!access_or_warn(path, R_OK, 0))
                add_excludes_from_file_1(dir, path,
                                         dir->untracked ? &dir->ss_info_exclude : NULL);