]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fetch-pack.c
fetch-pack: redact packfile urls in traces
[thirdparty/git.git] / fetch-pack.c
index a9604f35a3ea9055732d48e39b63a39f041f18f3..8b8c75f33aaf7331f0da761a2b84582c85422350 100644 (file)
@@ -1653,8 +1653,13 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
                                receive_wanted_refs(&reader, sought, nr_sought);
 
                        /* get the pack(s) */
+                       if (git_env_bool("GIT_TRACE_REDACT", 1))
+                               reader.options |= PACKET_READ_REDACT_URI_PATH;
                        if (process_section_header(&reader, "packfile-uris", 1))
                                receive_packfile_uris(&reader, &packfile_uris);
+                       /* We don't expect more URIs. Reset to avoid expensive URI check. */
+                       reader.options &= ~PACKET_READ_REDACT_URI_PATH;
+
                        process_section_header(&reader, "packfile", 0);
 
                        /*