Skip to content

Commit 36c60f7

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9442710 commit 36c60f7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

builtin/fetch-pack.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,8 @@ static struct ref *do_fetch_pack(int fd[2],
787787
{
788788
struct ref *ref = copy_ref_list(orig_ref);
789789
unsigned char sha1[20];
790+
const char *agent_feature;
791+
int agent_len;
790792

791793
sort_ref_list(&ref, ref_compare_name);
792794

@@ -829,8 +831,13 @@ static struct ref *do_fetch_pack(int fd[2],
829831
fprintf(stderr, "Server supports ofs-delta\n");
830832
} else
831833
prefer_ofs_delta = 0;
832-
if (server_supports("agent"))
834+
835+
if ((agent_feature = server_feature_value("agent", &agent_len))) {
833836
agent_supported = 1;
837+
if (args.verbose && agent_len)
838+
fprintf(stderr, "Server version is %.*s\n",
839+
agent_len, agent_feature);
840+
}
834841

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

0 commit comments

Comments
 (0)