diff options
Diffstat (limited to 'repository.c')
-rw-r--r-- | repository.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/repository.c b/repository.c index edca907404..f107af7d76 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, @@ -158,7 +160,7 @@ int repo_submodule_init(struct repository *submodule, struct strbuf worktree = STRBUF_INIT; int ret = 0; - sub = submodule_from_cache(superproject, null_sha1, path); + sub = submodule_from_cache(superproject, &null_oid, path); if (!sub) { ret = -1; goto out; @@ -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); } |