Skip to content

Commit

Permalink
fetch-pack: mention server version with verbose output
Browse files Browse the repository at this point in the history
Fetch-pack's verbose mode is more of a debugging mode (and
in fact takes two "-v" arguments to trigger via the
porcelain layer). Let's mention the server version as
another possible item of interest.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
peff authored and gitster committed Aug 14, 2012
1 parent 9442710 commit 36c60f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion builtin/fetch-pack.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -787,6 +787,8 @@ static struct ref *do_fetch_pack(int fd[2],
{ {
struct ref *ref = copy_ref_list(orig_ref); struct ref *ref = copy_ref_list(orig_ref);
unsigned char sha1[20]; unsigned char sha1[20];
const char *agent_feature;
int agent_len;


sort_ref_list(&ref, ref_compare_name); sort_ref_list(&ref, ref_compare_name);


Expand Down Expand Up @@ -829,8 +831,13 @@ static struct ref *do_fetch_pack(int fd[2],
fprintf(stderr, "Server supports ofs-delta\n"); fprintf(stderr, "Server supports ofs-delta\n");
} else } else
prefer_ofs_delta = 0; prefer_ofs_delta = 0;
if (server_supports("agent"))
if ((agent_feature = server_feature_value("agent", &agent_len))) {
agent_supported = 1; agent_supported = 1;
if (args.verbose && agent_len)
fprintf(stderr, "Server version is %.*s\n",
agent_len, agent_feature);
}


if (everything_local(&ref, nr_match, match)) { if (everything_local(&ref, nr_match, match)) {
packet_flush(fd[1]); packet_flush(fd[1]);
Expand Down

0 comments on commit 36c60f7

Please sign in to comment.