@@ -2971,6 +2971,19 @@ static int dirstat_compare(const void *_a, const void *_b)
2971
2971
return strcmp (a -> name , b -> name );
2972
2972
}
2973
2973
2974
+ static void conclude_dirstat (struct diff_options * options ,
2975
+ struct dirstat_dir * dir ,
2976
+ unsigned long changed )
2977
+ {
2978
+ /* This can happen even with many files, if everything was renames */
2979
+ if (!changed )
2980
+ return ;
2981
+
2982
+ /* Show all directories with more than x% of the changes */
2983
+ QSORT (dir -> files , dir -> nr , dirstat_compare );
2984
+ gather_dirstat (options , dir , changed , "" , 0 );
2985
+ }
2986
+
2974
2987
static void show_dirstat (struct diff_options * options )
2975
2988
{
2976
2989
int i ;
@@ -3060,13 +3073,7 @@ static void show_dirstat(struct diff_options *options)
3060
3073
dir .nr ++ ;
3061
3074
}
3062
3075
3063
- /* This can happen even with many files, if everything was renames */
3064
- if (!changed )
3065
- return ;
3066
-
3067
- /* Show all directories with more than x% of the changes */
3068
- QSORT (dir .files , dir .nr , dirstat_compare );
3069
- gather_dirstat (options , & dir , changed , "" , 0 );
3076
+ conclude_dirstat (options , & dir , changed );
3070
3077
}
3071
3078
3072
3079
static void show_dirstat_by_line (struct diffstat_t * data , struct diff_options * options )
@@ -3104,13 +3111,7 @@ static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *o
3104
3111
dir .nr ++ ;
3105
3112
}
3106
3113
3107
- /* This can happen even with many files, if everything was renames */
3108
- if (!changed )
3109
- return ;
3110
-
3111
- /* Show all directories with more than x% of the changes */
3112
- QSORT (dir .files , dir .nr , dirstat_compare );
3113
- gather_dirstat (options , & dir , changed , "" , 0 );
3114
+ conclude_dirstat (options , & dir , changed );
3114
3115
}
3115
3116
3116
3117
static void free_diffstat_file (struct diffstat_file * f )
0 commit comments