summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/diff.c b/diff.c
index e13d0f8b67..d52db685f7 100644
--- a/diff.c
+++ b/diff.c
@@ -2975,13 +2975,18 @@ static void conclude_dirstat(struct diff_options *options,
struct dirstat_dir *dir,
unsigned long changed)
{
- /* This can happen even with many files, if everything was renames */
- if (!changed)
- return;
+ struct dirstat_file *to_free = dir->files;
+
+ if (!changed) {
+ /* This can happen even with many files, if everything was renames */
+ ;
+ } else {
+ /* Show all directories with more than x% of the changes */
+ QSORT(dir->files, dir->nr, dirstat_compare);
+ gather_dirstat(options, dir, changed, "", 0);
+ }
- /* Show all directories with more than x% of the changes */
- QSORT(dir->files, dir->nr, dirstat_compare);
- gather_dirstat(options, dir, changed, "", 0);
+ free(to_free);
}
static void show_dirstat(struct diff_options *options)