diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2018-12-19 00:24:35 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-11 01:53:49 +0300 |
commit | 5056cf4a62338c013a723e37cbe1f525f1dcc29d (patch) | |
tree | 0e9a317a921307c77ccb12ab63ebf21fe7527ead /fetch-pack.c | |
parent | bd0b42aed3084bf66557485fd7d87e975a4f6d4e (diff) |
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>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index 5885623ece..577faa6229 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1007,6 +1007,8 @@ static void add_shallow_requests(struct strbuf *req_buf, packet_buf_write(req_buf, "deepen-not %s", s->string); } } + if (args->deepen_relative) + packet_buf_write(req_buf, "deepen-relative\n"); } static void add_wants(int no_dependents, const struct ref *wants, struct strbuf *req_buf) |