Skip to content

Commit 0cd0afc

Browse files
committed
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
2 parents eebb51b + d2d7fbe commit 0cd0afc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

diff.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6763,8 +6763,11 @@ void diff_change(struct diff_options *options,
67636763
return;
67646764

67656765
if (options->flags.quick && options->skip_stat_unmatch &&
6766-
!diff_filespec_check_stat_unmatch(options->repo, p))
6766+
!diff_filespec_check_stat_unmatch(options->repo, p)) {
6767+
diff_free_filespec_data(p->one);
6768+
diff_free_filespec_data(p->two);
67676769
return;
6770+
}
67686771

67696772
options->flags.has_changes = 1;
67706773
}

0 commit comments

Comments
 (0)