aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-08 10:41:20 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-08 10:41:20 -0700
commit3e12106370213f73c27bd7cf544b7400931ddb0d (patch)
tree6db8f4941cfd082f2397086cff35b78a3542cc2f
parentMerge branch 'ps/doc-more-c-coding-guidelines' (diff)
parentconvert: return early when not tracing (diff)
downloadgit-3e12106370213f73c27bd7cf544b7400931ddb0d.tar.gz
git-3e12106370213f73c27bd7cf544b7400931ddb0d.zip
Merge branch 'dh/encoding-trace-optim'
An expensive operation to prepare tracing was done in re-encoding code path even when the tracing was not requested, which has been corrected. * dh/encoding-trace-optim: convert: return early when not tracing
Diffstat (limited to '')
-rw-r--r--convert.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/convert.c b/convert.c
index d8737fe0f2..c4ddc4de81 100644
--- a/convert.c
+++ b/convert.c
@@ -324,6 +324,9 @@ static void trace_encoding(const char *context, const char *path,
struct strbuf trace = STRBUF_INIT;
int i;
+ if (!trace_want(&coe))
+ return;
+
strbuf_addf(&trace, "%s (%s, considered %s):\n", context, path, encoding);
for (i = 0; i < len && buf; ++i) {
strbuf_addf(