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