diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-22 10:29:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-22 10:29:01 -0700 |
commit | 5aa0b6c506c1f1336d0e713bf8225509e9ebb9f5 (patch) | |
tree | a0eaaf3110e43b2a4aec5f7023fbf62a655418de /repository.c | |
parent | 1016495a7190911b37c354f7a985278c51ae6666 (diff) | |
parent | f9ee2fcdfa05586b6a4476c7aa5f4f0162e48455 (diff) | |
download | git-5aa0b6c506c1f1336d0e713bf8225509e9ebb9f5.tar.gz |
Merge branch 'bw/grep-recurse-submodules'
"git grep --recurse-submodules" has been reworked to give a more
consistent output across submodule boundary (and do its thing
without having to fork a separate process).
* 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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/repository.c b/repository.c index 1617467568..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, @@ -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); } |