]> git.ipfire.org Git - thirdparty/git.git/blobdiff - repository.c
Merge branch 'bw/grep-recurse-submodules'
[thirdparty/git.git] / repository.c
index 1617467568c76e685d5f852c27ca16f26ed0494c..f107af7d763e848648ace5da0010be4df2e0d4dc 100644 (file)
@@ -4,7 +4,9 @@
 #include "submodule-config.h"
 
 /* The main repository */
-static struct repository the_repo;
+static struct repository the_repo = {
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, 0, 0
+};
 struct repository *the_repository = &the_repo;
 
 static char *git_path_from_env(const char *envvar, const char *git_dir,
@@ -235,8 +237,6 @@ int repo_read_index(struct repository *repo)
 {
        if (!repo->index)
                repo->index = xcalloc(1, sizeof(*repo->index));
-       else
-               discard_index(repo->index);
 
        return read_index_from(repo->index, repo->index_file);
 }