mmapped_ref_iterator: add iterator over a packed-refs file
commit9cfb3dc0d12a1db12c43edaa5e2545a6818ecc95
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 25 Sep 2017 08:00:07 +0000 (25 10:00 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Sep 2017 09:02:45 +0000 (25 18:02 +0900)
treeabd838ce2851bf2f05a5cdbc13aa9105fabd17b9
parentdaa45408c12053d608d86f0c1daa23b79815624f
mmapped_ref_iterator: add iterator over a packed-refs file

Add a new `mmapped_ref_iterator`, which can iterate over the
references in an mmapped `packed-refs` file directly. Use this
iterator from `read_packed_refs()` to fill the packed refs cache.

Note that we are not yet willing to promise that the new iterator
generates its output in order. That doesn't matter for now, because
the packed refs cache doesn't care what order it is filled.

This change adds a lot of boilerplate without providing any obvious
benefits. The benefits will come soon, when we get rid of the
`ref_cache` for packed references altogether.

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