repo_read_index: don't discard the index
commit3f13877595500bd54ee370167bc868f3c1eee5b7
authorBrandon Williams <bmwill@google.com>
Tue, 18 Jul 2017 19:05:18 +0000 (18 12:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2017 20:32:25 +0000 (18 13:32 -0700)
tree6a7940cc0ac743cc9b997cc6c6d7a4a7c41b4b68
parentf3da2b79be9565779e4f76dc5812c68e156afdf0
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>
repository.c
repository.h