aboutsummaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-02 14:33:47 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-02 14:33:47 -0700
commitdcc6108c3fca6ad3cc4e211a939e8de5c796fa68 (patch)
tree0f3d7f86435b4c9a1d2ec356ba5f4898ddb2d16e /repository.c
parent5800c63717ae35286a1441f14ffff753e01f7e2b (diff)
parentf9ee2fcdfa05586b6a4476c7aa5f4f0162e48455 (diff)
downloadgit-dcc6108c3fca6ad3cc4e211a939e8de5c796fa68.tar.gz
git-dcc6108c3fca6ad3cc4e211a939e8de5c796fa68.tar.xz
Merge branch 'bw/grep-recurse-submodules' into bw/submodule-config-cleanup
* bw/grep-recurse-submodules: grep: recurse in-process using 'struct repository' submodule: merge repo_read_gitmodules and gitmodules_config submodule: check for unmerged .gitmodules outside of config parsing submodule: check for unstaged .gitmodules outside of config parsing submodule: remove fetch.recursesubmodules from submodule-config parsing submodule: remove submodule.fetchjobs from submodule-config parsing config: add config_from_gitmodules cache.h: add GITMODULES_FILE macro repository: have the_repository use the_index repo_read_index: don't discard the index
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/repository.c b/repository.c
index edca90740..c0e0e0e7e 100644
--- a/repository.c
+++ b/repository.c
@@ -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);
}