diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-01-29 13:18:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-29 13:18:50 -0800 |
commit | 7b718fbf17f5b51887d420e6edc9dcb7b0c0f83c (patch) | |
tree | 4eb9885e931f18d6dfb9c3c6dc5484a0b60d1250 /builtin/receive-pack.c | |
parent | 7859f533e2247f21cdf3fa74e78b600c9ec62270 (diff) | |
parent | d336572f57e398318a0f6c51cc760d5be9872cc2 (diff) | |
download | git-7b718fbf17f5b51887d420e6edc9dcb7b0c0f83c.tar.gz git-7b718fbf17f5b51887d420e6edc9dcb7b0c0f83c.tar.xz |
Merge branch 'cb/push-quiet'
* 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 'builtin/receive-pack.c')
-rw-r--r-- | builtin/receive-pack.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 8c9e91e78..fa7448be5 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -33,6 +33,7 @@ static int transfer_unpack_limit = -1; static int unpack_limit = 100; static int report_status; static int use_sideband; +static int quiet; static int prefer_ofs_delta = 1; static int auto_update_server_info; static int auto_gc = 1; @@ -122,7 +123,7 @@ static void show_ref(const char *path, const unsigned char *sha1) else packet_write(1, "%s %s%c%s%s\n", sha1_to_hex(sha1), path, 0, - " report-status delete-refs side-band-64k", + " report-status delete-refs side-band-64k quiet", prefer_ofs_delta ? " ofs-delta" : ""); sent_capabilities = 1; } @@ -748,10 +749,13 @@ static struct command *read_head_info(void) refname = line + 82; reflen = strlen(refname); if (reflen + 82 < len) { - if (strstr(refname + reflen + 1, "report-status")) + const char *feature_list = refname + reflen + 1; + if (parse_feature_request(feature_list, "report-status")) report_status = 1; - if (strstr(refname + reflen + 1, "side-band-64k")) + if (parse_feature_request(feature_list, "side-band-64k")) use_sideband = LARGE_PACKET_MAX; + if (parse_feature_request(feature_list, "quiet")) + quiet = 1; } cmd = xcalloc(1, sizeof(struct command) + len - 80); hashcpy(cmd->old_sha1, old_sha1); @@ -805,8 +809,10 @@ static const char *unpack(void) if (ntohl(hdr.hdr_entries) < unpack_limit) { int code, i = 0; - const char *unpacker[4]; + const char *unpacker[5]; unpacker[i++] = "unpack-objects"; + if (quiet) + unpacker[i++] = "-q"; if (fsck_objects) unpacker[i++] = "--strict"; unpacker[i++] = hdr_arg; @@ -901,6 +907,11 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix) const char *arg = *argv++; if (*arg == '-') { + if (!strcmp(arg, "--quiet")) { + quiet = 1; + continue; + } + if (!strcmp(arg, "--advertise-refs")) { advertise_refs = 1; continue; |