summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-06-17 21:54:00 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-17 21:54:00 -0700
commit0cd0afc9c6193dd4a762f5a2d1bc23e58629b23f (patch)
tree092f30dc03f30dbc6875dabbeee644ab4df2ee65
parentMerge branch 'hn/refs-cleanup' (diff)
parentdiff: discard blob data from stat-unmatched pairs (diff)
downloadtgif-0cd0afc9c6193dd4a762f5a2d1bc23e58629b23f.tar.xz
Merge branch 'jk/diff-memuse-optim-with-stat-unmatch'
Reduce memory usage during "diff --quiet" in a worktree with too many stat-unmatched paths. * jk/diff-memuse-optim-with-stat-unmatch: diff: discard blob data from stat-unmatched pairs
-rw-r--r--diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 863da896c0..d24aaa3047 100644
--- a/diff.c
+++ b/diff.c
@@ -6763,8 +6763,11 @@ void diff_change(struct diff_options *options,
return;
if (options->flags.quick && options->skip_stat_unmatch &&
- !diff_filespec_check_stat_unmatch(options->repo, p))
+ !diff_filespec_check_stat_unmatch(options->repo, p)) {
+ diff_free_filespec_data(p->one);
+ diff_free_filespec_data(p->two);
return;
+ }
options->flags.has_changes = 1;
}