Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-07-18 22:05:18 +0300
committerJunio C Hamano <gitster@pobox.com>2017-07-18 23:32:25 +0300
commit3f13877595500bd54ee370167bc868f3c1eee5b7 (patch)
tree6a7940cc0ac743cc9b997cc6c6d7a4a7c41b4b68 /repository.c
parentf3da2b79be9565779e4f76dc5812c68e156afdf0 (diff)
repo_read_index: don't discard the index
Have 'repo_read_index()' behave more like the other read_index family of functions and don't discard the index if it has already been populated and instead rely on the quick return of read_index_from which has: /* istate->initialized covers both .git/index and .git/sharedindex.xxx */ if (istate->initialized) return istate->cache_nr; Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/repository.c b/repository.c
index edca907404..8e60af1d5f 100644
--- a/repository.c
+++ b/repository.c
@@ -235,8 +235,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);
}