refs: read loose references lazily
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 26 Apr 2012 22:27:07 +0000 (00:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 May 2012 20:15:36 +0000 (13:15 -0700)
commit28e6a34e254a1ee5fc3d106e4a6117fd02254589
treee225c27e768d90e2c0e07d9be9e24b5a6c4ff6a2
parent423a1afc0bc48bb5520d518b521ecf9d79f59bb3
refs: read loose references lazily

Instead of reading the whole directory of loose references the first
time any are needed, only read them on demand, one directory at a
time.

Use a new ref_entry flag bit REF_INCOMPLETE to indicate that the entry
represents a REF_DIR that hasn't been read yet.  Whenever any entries
from such a directory are needed, read all of the loose references
from that directory.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c