]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fetch-pack.c
Merge branch 'sd/negotiate-trace-fix' into maint-2.43
[thirdparty/git.git] / fetch-pack.c
index 26999e3b6591313a18df430170aaf935d2e24c14..091f9a80a9ee72593c5079b48f15ea22dbd59d4c 100644 (file)
@@ -10,7 +10,6 @@
 #include "pkt-line.h"
 #include "commit.h"
 #include "tag.h"
-#include "exec-cmd.h"
 #include "pack.h"
 #include "sideband.h"
 #include "fetch-pack.h"
@@ -18,7 +17,6 @@
 #include "run-command.h"
 #include "connect.h"
 #include "trace2.h"
-#include "transport.h"
 #include "version.h"
 #include "oid-array.h"
 #include "oidset.h"
@@ -1862,6 +1860,8 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
 static int fetch_pack_config_cb(const char *var, const char *value,
                                const struct config_context *ctx, void *cb)
 {
+       const char *msg_id;
+
        if (strcmp(var, "fetch.fsck.skiplist") == 0) {
                const char *path;
 
@@ -1873,12 +1873,14 @@ static int fetch_pack_config_cb(const char *var, const char *value,
                return 0;
        }
 
-       if (skip_prefix(var, "fetch.fsck.", &var)) {
-               if (is_valid_msg_type(var, value))
+       if (skip_prefix(var, "fetch.fsck.", &msg_id)) {
+               if (!value)
+                       return config_error_nonbool(var);
+               if (is_valid_msg_type(msg_id, value))
                        strbuf_addf(&fsck_msg_types, "%c%s=%s",
-                               fsck_msg_types.len ? ',' : '=', var, value);
+                               fsck_msg_types.len ? ',' : '=', msg_id, value);
                else
-                       warning("Skipping unknown msg id '%s'", var);
+                       warning("Skipping unknown msg id '%s'", msg_id);
                return 0;
        }
 
@@ -2214,7 +2216,7 @@ void negotiate_using_fetch(const struct oid_array *negotiation_tips,
                                           the_repository, "%d",
                                           negotiation_round);
        }
-       trace2_region_enter("fetch-pack", "negotiate_using_fetch", the_repository);
+       trace2_region_leave("fetch-pack", "negotiate_using_fetch", the_repository);
        trace2_data_intmax("negotiate_using_fetch", the_repository,
                           "total_rounds", negotiation_round);
        clear_common_flag(acked_commits);