Skip to content

Commit

Permalink
fetch-pack: print server version at the top in -v -v
Browse files Browse the repository at this point in the history
Before the previous patch, the server version is printed after all the
"Server supports" lines. The previous one puts the version in the middle
of "Server supports" group.

Instead of moving it to the bottom, I move it to the top. Version may
stand out more at the top as we will have even more debug out after
capabilities.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
pclouds authored and gitster committed Jun 20, 2019
1 parent 5a88583 commit 0e04297
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,13 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
sort_ref_list(&ref, ref_compare_name);
QSORT(sought, nr_sought, cmp_ref_by_name);

if ((agent_feature = server_feature_value("agent", &agent_len))) {
agent_supported = 1;
if (agent_len)
print_verbose(args, _("Server version is %.*s"),
agent_len, agent_feature);
}

if (server_supports("shallow"))
print_verbose(args, _("Server supports %s"), "shallow");
else if (args->depth > 0 || is_repository_shallow(the_repository))
Expand Down Expand Up @@ -961,12 +968,6 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
warning("filtering not recognized by server, ignoring");
}

if ((agent_feature = server_feature_value("agent", &agent_len))) {
agent_supported = 1;
if (agent_len)
print_verbose(args, _("Server version is %.*s"),
agent_len, agent_feature);
}
if (server_supports("deepen-since")) {
print_verbose(args, _("Server supports %s"), "deepen-since");
deepen_since_ok = 1;
Expand Down

0 comments on commit 0e04297

Please sign in to comment.