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
This commit is contained in:
Junio C Hamano 2020-06-17 21:54:00 -07:00
Родитель eebb51ba8c d2d7fbe129
Коммит 0cd0afc9c6
1 изменённых файлов: 4 добавлений и 1 удалений

5
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;
}