]> git.ipfire.org Git - thirdparty/git.git/blobdiff - serve.c
Start the 2.46 cycle
[thirdparty/git.git] / serve.c
diff --git a/serve.c b/serve.c
index a1d71134d49cc88ead5af690315b27ae23215e56..aa651b73e9b7a3378c51f7c92533a6dd0f82ce73 100644 (file)
--- a/serve.c
+++ b/serve.c
@@ -12,6 +12,7 @@
 #include "trace2.h"
 
 static int advertise_sid = -1;
+static int advertise_object_info = -1;
 static int client_hash_algo = GIT_HASH_SHA1;
 
 static int always_advertise(struct repository *r UNUSED,
@@ -67,6 +68,17 @@ static void session_id_receive(struct repository *r UNUSED,
        trace2_data_string("transfer", NULL, "client-sid", client_sid);
 }
 
+static int object_info_advertise(struct repository *r, struct strbuf *value UNUSED)
+{
+       if (advertise_object_info == -1 &&
+           repo_config_get_bool(r, "transfer.advertiseobjectinfo",
+                                &advertise_object_info)) {
+               /* disabled by default */
+               advertise_object_info = 0;
+       }
+       return advertise_object_info;
+}
+
 struct protocol_capability {
        /*
         * The name of the capability.  The server uses this name when
@@ -135,7 +147,7 @@ static struct protocol_capability capabilities[] = {
        },
        {
                .name = "object-info",
-               .advertise = always_advertise,
+               .advertise = object_info_advertise,
                .command = cap_object_info,
        },
        {