@@ -389,12 +389,10 @@ static struct string_list *get_unmerged(void)
389
389
return unmerged ;
390
390
}
391
391
392
- static int string_list_df_name_compare (const void * a , const void * b )
392
+ static int string_list_df_name_compare (const char * one , const char * two )
393
393
{
394
- const struct string_list_item * one = a ;
395
- const struct string_list_item * two = b ;
396
- int onelen = strlen (one -> string );
397
- int twolen = strlen (two -> string );
394
+ int onelen = strlen (one );
395
+ int twolen = strlen (two );
398
396
/*
399
397
* Here we only care that entries for D/F conflicts are
400
398
* adjacent, in particular with the file of the D/F conflict
@@ -407,8 +405,8 @@ static int string_list_df_name_compare(const void *a, const void *b)
407
405
* since in other cases any changes in their order due to
408
406
* sorting cause no problems for us.
409
407
*/
410
- int cmp = df_name_compare (one -> string , onelen , S_IFDIR ,
411
- two -> string , twolen , S_IFDIR );
408
+ int cmp = df_name_compare (one , onelen , S_IFDIR ,
409
+ two , twolen , S_IFDIR );
412
410
/*
413
411
* Now that 'foo' and 'foo/bar' compare equal, we have to make sure
414
412
* that 'foo' comes before 'foo/bar'.
@@ -452,8 +450,8 @@ static void record_df_conflict_files(struct merge_options *o,
452
450
string_list_append (& df_sorted_entries , next -> string )-> util =
453
451
next -> util ;
454
452
}
455
- qsort ( df_sorted_entries .items , entries -> nr , sizeof ( * entries -> items ),
456
- string_list_df_name_compare );
453
+ df_sorted_entries .cmp = string_list_df_name_compare ;
454
+ string_list_sort ( & df_sorted_entries );
457
455
458
456
string_list_clear (& o -> df_conflict_file_set , 1 );
459
457
for (i = 0 ; i < df_sorted_entries .nr ; i ++ ) {
0 commit comments