]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_file.c
[PATCH] Provide access to git_dir through get_git_dir().
[thirdparty/git.git] / sha1_file.c
index 66382027816e8ec3a97c40f6849c62454f2ad0f2..fe374c6132a74641959e201f8c03dd9952e9acee 100644 (file)
@@ -70,6 +70,13 @@ static void setup_git_env(void)
                git_graft_file = strdup(git_path("info/grafts"));
 }
 
+char *get_git_dir(void)
+{
+       if (!git_dir)
+               setup_git_env();
+       return git_dir;
+}
+
 char *get_object_directory(void)
 {
        if (!git_object_dir)