diff options
| author | Junio C Hamano <gitster@pobox.com> | 2012-02-05 23:58:42 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2012-02-05 23:58:42 -0800 |
| commit | 4802997c7531835f16b6fce690854d9a75119d0b (patch) | |
| tree | 1199a1a8e09b18543e2adf3faccb5ee292d554cf /upload-pack.c | |
| parent | 1c719ffc3d1c4e03313d5cf5c4d32ec763697857 (diff) | |
| parent | d336572f57e398318a0f6c51cc760d5be9872cc2 (diff) | |
| download | git-4802997c7531835f16b6fce690854d9a75119d0b.tar.gz | |
Merge branch 'cb/push-quiet' into maint
* cb/push-quiet:
t5541: avoid TAP test miscounting
fix push --quiet: add 'quiet' capability to receive-pack
server_supports(): parse feature list more carefully
Diffstat (limited to 'upload-pack.c')
| -rw-r--r-- | upload-pack.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/upload-pack.c b/upload-pack.c index 6f36f6255c..0d11e21a68 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -585,6 +585,7 @@ static void receive_needs(void) write_str_in_full(debug_fd, "#S\n"); for (;;) { struct object *o; + const char *features; unsigned char sha1_buf[20]; len = packet_read_line(0, line, sizeof(line)); reset_timeout(); @@ -616,23 +617,26 @@ static void receive_needs(void) get_sha1_hex(line+5, sha1_buf)) die("git upload-pack: protocol error, " "expected to get sha, not '%s'", line); - if (strstr(line+45, "multi_ack_detailed")) + + features = line + 45; + + if (parse_feature_request(features, "multi_ack_detailed")) multi_ack = 2; - else if (strstr(line+45, "multi_ack")) + else if (parse_feature_request(features, "multi_ack")) multi_ack = 1; - if (strstr(line+45, "no-done")) + if (parse_feature_request(features, "no-done")) no_done = 1; - if (strstr(line+45, "thin-pack")) + if (parse_feature_request(features, "thin-pack")) use_thin_pack = 1; - if (strstr(line+45, "ofs-delta")) + if (parse_feature_request(features, "ofs-delta")) use_ofs_delta = 1; - if (strstr(line+45, "side-band-64k")) + if (parse_feature_request(features, "side-band-64k")) use_sideband = LARGE_PACKET_MAX; - else if (strstr(line+45, "side-band")) + else if (parse_feature_request(features, "side-band")) use_sideband = DEFAULT_PACKET_MAX; - if (strstr(line+45, "no-progress")) + if (parse_feature_request(features, "no-progress")) no_progress = 1; - if (strstr(line+45, "include-tag")) + if (parse_feature_request(features, "include-tag")) use_include_tag = 1; o = lookup_object(sha1_buf); |
