repack_without_ref(): split list curation and entry writing
commit7b40d3963835699e138d21f6040a60c07e797853
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 20 Jun 2013 08:37:43 +0000 (20 10:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2013 22:50:16 +0000 (20 15:50 -0700)
tree207da50433373522c1e77db5ba10cdbffc698da9
parentede63a195c53d31207d694258bd8bc740dbc87a7
repack_without_ref(): split list curation and entry writing

The repack_without_ref() function first removes the deleted ref from
the internal packed-refs list, then writes the packed-refs list to
disk, omitting any broken or stale entries.  This patch splits that
second step into multiple passes:

* collect the list of refnames that should be deleted from packed_refs

* delete those refnames from the cache

* write the remainder to the packed-refs file

The purpose of this change is to make the "write the remainder" part
reusable.

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