]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
pack_one_ref(): use function peel_entry()
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 22 Apr 2013 19:52:37 +0000 (21:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 May 2013 22:33:11 +0000 (15:33 -0700)
commitf85354b5c7b800912743927f4abba022444163fd
treeb836e47afa80f313f7eff7d4800421b9b9d165d3
parent8d3725b96fa6878fabe5ec715ff7b9f263481ea1
pack_one_ref(): use function peel_entry()

Change pack_one_ref() to call peel_entry() rather than using its own
code for peeling references.  Aside from sharing code, this lets it
take advantage of the optimization introduced by 6c4a060d7d.

Please note that we *could* use any peeled values that happen to
already be stored in the ref_entries, which would avoid some object
lookups for references that were already packed.  But doing so would
also propagate any peeling errors across runs of "git pack-refs" and
give no way to recover from such errors.  And "git pack-refs" isn't
run often enough that the performance cost is a problem.  So instead,
add a new option to peel_entry() to force the entry to be re-peeled,
and call it with that option set.

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