send-pack: do not send unknown object name from ".have" to pack-objects
commit02322e1619dc537dc48650761f6c9bae883612a7
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Jan 2009 04:21:31 +0000 (27 20:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Jan 2009 07:46:59 +0000 (27 23:46 -0800)
tree2c6f23d10d167be3e86b3c4d8ddd6c8c19445eda
parent899d8dc392494e78040ea13db202de894040bda8
send-pack: do not send unknown object name from ".have" to pack-objects

v1.6.1 introduced ".have" extension to the protocol to allow the receiving
side to advertise objects that are reachable from refs in the repositories
it borrows from.  This was meant to be used by the sending side to avoid
sending such objects; they are already available through the alternates
mechanism.

The client side implementation in v1.6.1, which was introduced with
40c155f (push: prepare sender to receive extended ref information from the
receiver, 2008-09-09) aka v1.6.1-rc1~203^2~1, were faulty in that it did
not consider the possiblity that the repository receiver borrows from
might have objects it does not know about.

This fixes it by refraining from passing missing commits to underlying
pack-objects.  Revision machinery may need to be tightened further to
treat missing uninteresting objects as non-error events, but this is an
obvious and safe fix for a maintenance release that is almost good enough.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-send-pack.c
t/t5519-push-alternates.sh [new file with mode: 0755]