fetch-pack: mention server version with verbose output

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>

Jeff King committed Aug 13, 2012 at 22:02 UTC 36c60f7a08b28e2cee649d697291ac6b708b213f
1 file changed +8 -1
builtin/fetch-pack.c
+8 -1
@@ -787,6 +787,8 @@ static struct ref *do_fetch_pack(int fd[2],
787 {
788 struct ref *ref = copy_ref_list(orig_ref);
789 unsigned char sha1[20];
790 + const char *agent_feature;
791 + int agent_len;
792
793 sort_ref_list(&ref, ref_compare_name);
794
@@ -829,8 +831,13 @@ static struct ref *do_fetch_pack(int fd[2],
831 fprintf(stderr, "Server supports ofs-delta\n");
832 } else
833 prefer_ofs_delta = 0;
832 - if (server_supports("agent"))
834 +
835 + if ((agent_feature = server_feature_value("agent", &agent_len))) {
836 agent_supported = 1;
837 + if (args.verbose && agent_len)
838 + fprintf(stderr, "Server version is %.*s\n",
839 + agent_len, agent_feature);
840 + }
841
842 if (everything_local(&ref, nr_match, match)) {
843 packet_flush(fd[1]);