diff options
| author | D Harithamma <harithamma.d@ibm.com> | 2024-07-31 13:33:59 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-07-31 08:54:13 -0700 |
| commit | 63ad8dbf169ec8e2b3cef40ff51499ee751a84a5 (patch) | |
| tree | 315d9afe91216f5f8b0862c4e8ce7d7b3b91256e /t/unit-tests/u-oid-array.c | |
| parent | c2b3f2b3cdbf5ad9feb978dd367d77561a1271f7 (diff) | |
convert: return early when not tracing
When Git adds a file requiring encoding conversion and tracing of encoding
conversion is not requested via the GIT_TRACE_WORKING_TREE_ENCODING
environment variable, the `trace_encoding()` function still allocates &
prepares "human readable" copies of the file contents before and after
conversion to show in the trace. This results in a high memory footprint
and increased runtime without providing any user-visible benefit.
This fix introduces an early exit from the `trace_encoding()` function
when tracing is not requested, preventing unnecessary memory allocation
and processing.
Signed-off-by: D Harithamma <harithamma.d@ibm.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/u-oid-array.c')
0 files changed, 0 insertions, 0 deletions
