Skip to content

Commit 6f4f191

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 9e471b6 commit 6f4f191

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
@@ -68,14 +68,16 @@ static void session_id_receive(struct repository *r UNUSED,
6868
trace2_data_string("transfer", NULL, "client-sid", client_sid);
6969
}
7070

71-
static int object_info_advertise(struct repository *r, struct strbuf *value UNUSED)
71+
static int object_info_advertise(struct repository *r, struct strbuf *value)
7272
{
7373
if (advertise_object_info == -1 &&
7474
repo_config_get_bool(r, "transfer.advertiseobjectinfo",
7575
&advertise_object_info)) {
7676
/* disabled by default */
7777
advertise_object_info = 0;
7878
}
79+
if (value && advertise_object_info)
80+
strbuf_addstr(value, "size");
7981
return advertise_object_info;
8082
}
8183

0 commit comments

Comments
 (0)