remote: advertise the object-format capability on the server side
Advertise the current hash algorithm in use by using the object-format capability as part of the ref advertisement. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
14570dc67d
commit
bf30dbf826
@ -248,6 +248,7 @@ static void show_ref(const char *path, const struct object_id *oid)
|
|||||||
strbuf_addf(&cap, " push-cert=%s", push_cert_nonce);
|
strbuf_addf(&cap, " push-cert=%s", push_cert_nonce);
|
||||||
if (advertise_push_options)
|
if (advertise_push_options)
|
||||||
strbuf_addstr(&cap, " push-options");
|
strbuf_addstr(&cap, " push-options");
|
||||||
|
strbuf_addf(&cap, " object-format=%s", the_hash_algo->name);
|
||||||
strbuf_addf(&cap, " agent=%s", git_user_agent_sanitized());
|
strbuf_addf(&cap, " agent=%s", git_user_agent_sanitized());
|
||||||
packet_write_fmt(1, "%s %s%c%s\n",
|
packet_write_fmt(1, "%s %s%c%s\n",
|
||||||
oid_to_hex(oid), path, 0, cap.buf);
|
oid_to_hex(oid), path, 0, cap.buf);
|
||||||
|
@ -1005,7 +1005,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
|
|||||||
struct strbuf symref_info = STRBUF_INIT;
|
struct strbuf symref_info = STRBUF_INIT;
|
||||||
|
|
||||||
format_symref_info(&symref_info, cb_data);
|
format_symref_info(&symref_info, cb_data);
|
||||||
packet_write_fmt(1, "%s %s%c%s%s%s%s%s%s agent=%s\n",
|
packet_write_fmt(1, "%s %s%c%s%s%s%s%s%s object-format=%s agent=%s\n",
|
||||||
oid_to_hex(oid), refname_nons,
|
oid_to_hex(oid), refname_nons,
|
||||||
0, capabilities,
|
0, capabilities,
|
||||||
(allow_unadvertised_object_request & ALLOW_TIP_SHA1) ?
|
(allow_unadvertised_object_request & ALLOW_TIP_SHA1) ?
|
||||||
@ -1015,6 +1015,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
|
|||||||
stateless_rpc ? " no-done" : "",
|
stateless_rpc ? " no-done" : "",
|
||||||
symref_info.buf,
|
symref_info.buf,
|
||||||
allow_filter ? " filter" : "",
|
allow_filter ? " filter" : "",
|
||||||
|
the_hash_algo->name,
|
||||||
git_user_agent_sanitized());
|
git_user_agent_sanitized());
|
||||||
strbuf_release(&symref_info);
|
strbuf_release(&symref_info);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user