Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-30 08:04:10 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-30 08:04:10 +0300
commit54db5c0e1edf0d92bd474f515fab349b98c18a24 (patch)
tree9da6fa1473068ed9e5f9361911bfe697ae7f94eb /fetch-pack.c
parent42c8ce1c49f862c98b35e4d89c88aa3d489d6608 (diff)
parentba95710a3bdcb2a80495b1d93a0e482dd69905e1 (diff)
Merge branch 'jt/partial-clone-proto-v2'
Transfer protocol v2 learned to support the partial clone. * jt/partial-clone-proto-v2: {fetch,upload}-pack: support filter in protocol v2 upload-pack: read config when serving protocol v2 upload-pack: fix error message typo
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 490c38f833..a320ce9872 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1198,14 +1198,29 @@ static int send_fetch_request(int fd_out, const struct fetch_pack_args *args,
else if (is_repository_shallow() || args->deepen)
die(_("Server does not support shallow requests"));
+ /* Add filter */
+ if (server_supports_feature("fetch", "filter", 0) &&
+ args->filter_options.choice) {
+ print_verbose(args, _("Server supports filter"));
+ packet_buf_write(&req_buf, "filter %s",
+ args->filter_options.filter_spec);
+ } else if (args->filter_options.choice) {
+ warning("filtering not recognized by server, ignoring");
+ }
+
/* add wants */
add_wants(wants, &req_buf);
- /* Add all of the common commits we've found in previous rounds */
- add_common(&req_buf, common);
+ if (args->no_dependents) {
+ packet_buf_write(&req_buf, "done");
+ ret = 1;
+ } else {
+ /* Add all of the common commits we've found in previous rounds */
+ add_common(&req_buf, common);
- /* Add initial haves */
- ret = add_haves(&req_buf, haves_to_send, in_vain);
+ /* Add initial haves */
+ ret = add_haves(&req_buf, haves_to_send, in_vain);
+ }
/* Send request */
packet_buf_flush(&req_buf);