Skip to content

Commit ab4cc9d

Browse files
calvin-wan-googlegitster
authored andcommitted
serve: advertise object-info feature
In order for a client to know what object-info components a server can provide, advertise supported object-info features. This will allow a client to decide whether to query the server for object-info or fetch as a fallback. Helped-by: Jonathan Tan <[email protected]> Helped-by: Christian Couder <[email protected]> Signed-off-by: Calvin Wan <[email protected]> Signed-off-by: Eric Ju <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ed20a1b commit ab4cc9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

serve.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ static void session_id_receive(struct repository *r UNUSED,
7070
trace2_data_string("transfer", NULL, "client-sid", client_sid);
7171
}
7272

73-
static int object_info_advertise(struct repository *r, struct strbuf *value UNUSED)
73+
static int object_info_advertise(struct repository *r, struct strbuf *value)
7474
{
7575
if (advertise_object_info == -1 &&
7676
repo_config_get_bool(r, "transfer.advertiseobjectinfo",
7777
&advertise_object_info)) {
7878
/* disabled by default */
7979
advertise_object_info = 0;
8080
}
81+
if (value && advertise_object_info)
82+
strbuf_addstr(value, "size");
8183
return advertise_object_info;
8284
}
8385

0 commit comments

Comments
 (0)