Signed-off-by: Stefan Beller <sbel...@google.com>
---
 builtin/receive-pack.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index e0ce78e..a077b1d 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -71,6 +71,8 @@ static long nonce_stamp_slop;
 static unsigned long nonce_stamp_slop_limit;
 static struct ref_transaction *transaction;
 
+static const char *advertised_versions = NULL;
+
 static enum deny_action parse_deny_action(const char *var, const char *value)
 {
        if (value) {
@@ -168,6 +170,9 @@ static int receive_pack_config(const char *var, const char 
*value, void *cb)
                return 0;
        }
 
+       if (strcmp(var, "receive.advertisedversions") == 0)
+               return git_config_string(&advertised_versions, var, value);
+
        return git_default_config(var, value, cb);
 }
 
@@ -189,6 +194,8 @@ static void show_ref(const char *path, const unsigned char 
*sha1)
                        strbuf_addstr(&cap, " ofs-delta");
                if (push_cert_nonce)
                        strbuf_addf(&cap, " push-cert=%s", push_cert_nonce);
+               if (advertise_versions)
+                       strbuf_addstr(&cap, " versions=%s", advertise_versions);
                strbuf_addf(&cap, " agent=%s", git_user_agent_sanitized());
                packet_write(1, "%s %s%c%s\n",
                             sha1_to_hex(sha1), path, 0, cap.buf);
-- 
2.3.0.81.gc37f363

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to