Linus Torvalds [off-list ref] writes:
On Mon, 18 Sep 2006, Junio C Hamano wrote:
quoted
I am not sure I got the locking right, hence this RFC.
It looks correct (the important part to check is that the SHA1 of the ref
you remove still matches the SHA1 of the object you packed).
That said, we should fix it up a bit, notably
- we should _not_ prune refs that are indirect.
- we should probably avoid even trying to prune stuff that was already
packed.
The way to fix both these problems at once would be to add a flag to the
"for_each_ref()", which says whether it followed a link, or whether it was
already packed, so that we wouldn't pack symlinks at all, and we wouldn't
add already-packed refs to the "keeprefs" list.
But that requires a sligh semantic extension to "do_for_each_ref()" (and
"struct ref_list" needs a flag to say whether it was looked up through a
symlink).
Ok, so I did these and the result is a 4-patch series.