]> git.ipfire.org Git - thirdparty/git.git/commit - fetch-pack.c
upload-pack: teach deepen-relative in protocol v2
authorJonathan Tan <jonathantanmy@google.com>
Tue, 18 Dec 2018 21:24:35 +0000 (13:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Jan 2019 22:53:49 +0000 (14:53 -0800)
commit5056cf4a62338c013a723e37cbe1f525f1dcc29d
tree0e9a317a921307c77ccb12ab63ebf21fe7527ead
parentbd0b42aed3084bf66557485fd7d87e975a4f6d4e
upload-pack: teach deepen-relative in protocol v2

Commit 685fbd3291 ("fetch-pack: perform a fetch using v2", 2018-03-15)
attempted to teach Git deepen-relative in protocol v2 (among other
things), but it didn't work:

 (1) fetch-pack.c needs to emit "deepen-relative".
 (2) upload-pack.c needs to ensure that the correct deepen_relative
     variable is passed to deepen() (there are two - the static variable
     and the one in struct upload_pack_data).
 (3) Before deepen() computes the list of reachable shallows, it first
     needs to mark all "our" refs as OUR_REF. v2 currently does not do
     this, because unlike v0, it is not needed otherwise.

Fix all this and include a test demonstrating that it works now. For
(2), the static variable deepen_relative is also eliminated, removing a
source of confusion.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fetch-pack.c
t/t5702-protocol-v2.sh
upload-pack.c