]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http-fetch: invoke trace2_cmd_name()
authorJonathan Tan <jonathantanmy@google.com>
Mon, 12 Dec 2022 22:46:30 +0000 (14:46 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Dec 2022 01:43:07 +0000 (10:43 +0900)
ee4512ed48 ("trace2: create new combined trace facility", 2019-02-
22) introduced trace2_cmd_name() and taught both the Git built-ins and
some non-built-ins to use it. However, http-fetch was not one of them
(perhaps due to its low usage at the time).

Teach http-fetch to invoke this function. After this patch, this
function will be invoked right after argument parsing, just like in
remote-curl.c.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-fetch.c

index 31bc5c7767ce865bb3fb1a89f311f7d2b03c7e6d..258fec2068262c815ae68b08c8729b0bc60ee498 100644 (file)
@@ -5,6 +5,7 @@
 #include "walker.h"
 #include "strvec.h"
 #include "urlmatch.h"
+#include "trace2.h"
 
 static const char http_fetch_usage[] = "git http-fetch "
 "[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin | --packfile=hash | commit-id] url";
@@ -137,6 +138,8 @@ int cmd_main(int argc, const char **argv)
        if (nongit)
                die(_("not a git repository"));
 
+       trace2_cmd_name("http-fetch");
+
        git_config(git_default_config, NULL);
 
        if (packfile) {