@@ -721,23 +721,6 @@ static void clear_or_reinit_internal_opts(struct merge_options_internal *opti,
721
721
renames -> callback_data_nr = renames -> callback_data_alloc = 0 ;
722
722
}
723
723
724
- __attribute__((format (printf , 2 , 3 )))
725
- static int err (struct merge_options * opt , const char * err , ...)
726
- {
727
- va_list params ;
728
- struct strbuf sb = STRBUF_INIT ;
729
-
730
- strbuf_addstr (& sb , "error: " );
731
- va_start (params , err );
732
- strbuf_vaddf (& sb , err , params );
733
- va_end (params );
734
-
735
- error ("%s" , sb .buf );
736
- strbuf_release (& sb );
737
-
738
- return -1 ;
739
- }
740
-
741
724
static void format_commit (struct strbuf * sb ,
742
725
int indent ,
743
726
struct repository * repo ,
@@ -2122,13 +2105,12 @@ static int handle_content_merge(struct merge_options *opt,
2122
2105
& result_buf );
2123
2106
2124
2107
if ((merge_status < 0 ) || !result_buf .ptr )
2125
- ret = err ( opt , _ ("Failed to execute internal merge" ));
2108
+ ret = error ( _ ("failed to execute internal merge" ));
2126
2109
2127
2110
if (!ret &&
2128
2111
write_object_file (result_buf .ptr , result_buf .size ,
2129
2112
OBJ_BLOB , & result -> oid ))
2130
- ret = err (opt , _ ("Unable to add %s to database" ),
2131
- path );
2113
+ ret = error (_ ("unable to add %s to database" ), path );
2132
2114
2133
2115
free (result_buf .ptr );
2134
2116
if (ret )
@@ -3342,10 +3324,7 @@ static int collect_renames(struct merge_options *opt,
3342
3324
return clean ;
3343
3325
}
3344
3326
3345
- static int detect_and_process_renames (struct merge_options * opt ,
3346
- struct tree * merge_base ,
3347
- struct tree * side1 ,
3348
- struct tree * side2 )
3327
+ static int detect_and_process_renames (struct merge_options * opt )
3349
3328
{
3350
3329
struct diff_queue_struct combined = { 0 };
3351
3330
struct rename_info * renames = & opt -> priv -> renames ;
@@ -3509,19 +3488,18 @@ static int sort_dirs_next_to_their_children(const char *one, const char *two)
3509
3488
return c1 - c2 ;
3510
3489
}
3511
3490
3512
- static int read_oid_strbuf (struct merge_options * opt ,
3513
- const struct object_id * oid ,
3491
+ static int read_oid_strbuf (const struct object_id * oid ,
3514
3492
struct strbuf * dst )
3515
3493
{
3516
3494
void * buf ;
3517
3495
enum object_type type ;
3518
3496
unsigned long size ;
3519
3497
buf = repo_read_object_file (the_repository , oid , & type , & size );
3520
3498
if (!buf )
3521
- return err ( opt , _ ("cannot read object %s" ), oid_to_hex (oid ));
3499
+ return error ( _ ("cannot read object %s" ), oid_to_hex (oid ));
3522
3500
if (type != OBJ_BLOB ) {
3523
3501
free (buf );
3524
- return err ( opt , _ ("object %s is not a blob" ), oid_to_hex (oid ));
3502
+ return error ( _ ("object %s is not a blob" ), oid_to_hex (oid ));
3525
3503
}
3526
3504
strbuf_attach (dst , buf , size , size + 1 );
3527
3505
return 0 ;
@@ -3545,8 +3523,8 @@ static int blob_unchanged(struct merge_options *opt,
3545
3523
if (oideq (& base -> oid , & side -> oid ))
3546
3524
return 1 ;
3547
3525
3548
- if (read_oid_strbuf (opt , & base -> oid , & basebuf ) ||
3549
- read_oid_strbuf (opt , & side -> oid , & sidebuf ))
3526
+ if (read_oid_strbuf (& base -> oid , & basebuf ) ||
3527
+ read_oid_strbuf (& side -> oid , & sidebuf ))
3550
3528
goto error_return ;
3551
3529
/*
3552
3530
* Note: binary | is used so that both renormalizations are
@@ -4902,8 +4880,7 @@ static void merge_start(struct merge_options *opt, struct merge_result *result)
4902
4880
trace2_region_leave ("merge" , "allocate/init" , opt -> repo );
4903
4881
}
4904
4882
4905
- static void merge_check_renames_reusable (struct merge_options * opt ,
4906
- struct merge_result * result ,
4883
+ static void merge_check_renames_reusable (struct merge_result * result ,
4907
4884
struct tree * merge_base ,
4908
4885
struct tree * side1 ,
4909
4886
struct tree * side2 )
@@ -4973,7 +4950,7 @@ static void merge_ort_nonrecursive_internal(struct merge_options *opt,
4973
4950
* TRANSLATORS: The %s arguments are: 1) tree hash of a merge
4974
4951
* base, and 2-3) the trees for the two trees we're merging.
4975
4952
*/
4976
- err ( opt , _ ("collecting merge info failed for trees %s, %s, %s" ),
4953
+ error ( _ ("collecting merge info failed for trees %s, %s, %s" ),
4977
4954
oid_to_hex (& merge_base -> object .oid ),
4978
4955
oid_to_hex (& side1 -> object .oid ),
4979
4956
oid_to_hex (& side2 -> object .oid ));
@@ -4983,8 +4960,7 @@ static void merge_ort_nonrecursive_internal(struct merge_options *opt,
4983
4960
trace2_region_leave ("merge" , "collect_merge_info" , opt -> repo );
4984
4961
4985
4962
trace2_region_enter ("merge" , "renames" , opt -> repo );
4986
- result -> clean = detect_and_process_renames (opt , merge_base ,
4987
- side1 , side2 );
4963
+ result -> clean = detect_and_process_renames (opt );
4988
4964
trace2_region_leave ("merge" , "renames" , opt -> repo );
4989
4965
if (opt -> priv -> renames .redo_after_renames == 2 ) {
4990
4966
trace2_region_enter ("merge" , "reset_maps" , opt -> repo );
@@ -5106,7 +5082,7 @@ void merge_incore_nonrecursive(struct merge_options *opt,
5106
5082
5107
5083
trace2_region_enter ("merge" , "merge_start" , opt -> repo );
5108
5084
assert (opt -> ancestor != NULL );
5109
- merge_check_renames_reusable (opt , result , merge_base , side1 , side2 );
5085
+ merge_check_renames_reusable (result , merge_base , side1 , side2 );
5110
5086
merge_start (opt , result );
5111
5087
/*
5112
5088
* Record the trees used in this merge, so if there's a next merge in
0 commit comments