]> git.neil.brown.name Git - git.git/commit
repo_read_index: don't discard the index
authorBrandon Williams <bmwill@google.com>
Fri, 14 Jul 2017 22:28:24 +0000 (15:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jul 2017 20:23:16 +0000 (13:23 -0700)
commite756027053677febc32030b3ad7b43eab914aa1c
treea3e83a1fa1da1cc04d65ff667b0ae7bf1a74c8b8
parent85ce4a6828a418a22c69a870b3e059481b4263d6
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