@@ -224,17 +224,6 @@ static struct commit *make_virtual_commit(struct repository *repo,
224
224
return commit ;
225
225
}
226
226
227
- /*
228
- * Since we use get_tree_entry(), which does not put the read object into
229
- * the object pool, we cannot rely on a == b.
230
- */
231
- static int oid_eq (const struct object_id * a , const struct object_id * b )
232
- {
233
- if (!a && !b )
234
- return 2 ;
235
- return a && b && oideq (a , b );
236
- }
237
-
238
227
enum rename_type {
239
228
RENAME_NORMAL = 0 ,
240
229
RENAME_VIA_DIR ,
@@ -805,7 +794,7 @@ static int was_tracked_and_matches(struct merge_options *opt, const char *path,
805
794
806
795
/* See if the file we were tracking before matches */
807
796
ce = opt -> priv -> orig_index .cache [pos ];
808
- return (oid_eq (& ce -> oid , & blob -> oid ) && ce -> ce_mode == blob -> mode );
797
+ return (oideq (& ce -> oid , & blob -> oid ) && ce -> ce_mode == blob -> mode );
809
798
}
810
799
811
800
/*
@@ -1317,7 +1306,7 @@ static int merge_mode_and_contents(struct merge_options *opt,
1317
1306
oidcpy (& result -> blob .oid , & b -> oid );
1318
1307
}
1319
1308
} else {
1320
- if (!oid_eq (& a -> oid , & o -> oid ) && !oid_eq (& b -> oid , & o -> oid ))
1309
+ if (!oideq (& a -> oid , & o -> oid ) && !oideq (& b -> oid , & o -> oid ))
1321
1310
result -> merge = 1 ;
1322
1311
1323
1312
/*
@@ -1333,9 +1322,9 @@ static int merge_mode_and_contents(struct merge_options *opt,
1333
1322
}
1334
1323
}
1335
1324
1336
- if (oid_eq (& a -> oid , & b -> oid ) || oid_eq (& a -> oid , & o -> oid ))
1325
+ if (oideq (& a -> oid , & b -> oid ) || oideq (& a -> oid , & o -> oid ))
1337
1326
oidcpy (& result -> blob .oid , & b -> oid );
1338
- else if (oid_eq (& b -> oid , & o -> oid ))
1327
+ else if (oideq (& b -> oid , & o -> oid ))
1339
1328
oidcpy (& result -> blob .oid , & a -> oid );
1340
1329
else if (S_ISREG (a -> mode )) {
1341
1330
mmbuffer_t result_buf ;
@@ -1368,7 +1357,7 @@ static int merge_mode_and_contents(struct merge_options *opt,
1368
1357
switch (opt -> recursive_variant ) {
1369
1358
case MERGE_VARIANT_NORMAL :
1370
1359
oidcpy (& result -> blob .oid , & a -> oid );
1371
- if (!oid_eq (& a -> oid , & b -> oid ))
1360
+ if (!oideq (& a -> oid , & b -> oid ))
1372
1361
result -> clean = 0 ;
1373
1362
break ;
1374
1363
case MERGE_VARIANT_OURS :
@@ -2836,15 +2825,15 @@ static int process_renames(struct merge_options *opt,
2836
2825
dst_other .mode = ren1 -> dst_entry -> stages [other_stage ].mode ;
2837
2826
try_merge = 0 ;
2838
2827
2839
- if (oid_eq (& src_other .oid , & null_oid ) &&
2828
+ if (oideq (& src_other .oid , & null_oid ) &&
2840
2829
ren1 -> dir_rename_original_type == 'A' ) {
2841
2830
setup_rename_conflict_info (RENAME_VIA_DIR ,
2842
2831
opt , ren1 , NULL );
2843
- } else if (oid_eq (& src_other .oid , & null_oid )) {
2832
+ } else if (oideq (& src_other .oid , & null_oid )) {
2844
2833
setup_rename_conflict_info (RENAME_DELETE ,
2845
2834
opt , ren1 , NULL );
2846
2835
} else if ((dst_other .mode == ren1 -> pair -> two -> mode ) &&
2847
- oid_eq (& dst_other .oid , & ren1 -> pair -> two -> oid )) {
2836
+ oideq (& dst_other .oid , & ren1 -> pair -> two -> oid )) {
2848
2837
/*
2849
2838
* Added file on the other side identical to
2850
2839
* the file being renamed: clean merge.
@@ -2859,7 +2848,7 @@ static int process_renames(struct merge_options *opt,
2859
2848
1 , /* update_cache */
2860
2849
0 /* update_wd */ ))
2861
2850
clean_merge = -1 ;
2862
- } else if (!oid_eq (& dst_other .oid , & null_oid )) {
2851
+ } else if (!oideq (& dst_other .oid , & null_oid )) {
2863
2852
/*
2864
2853
* Probably not a clean merge, but it's
2865
2854
* premature to set clean_merge to 0 here,
@@ -3037,7 +3026,7 @@ static int blob_unchanged(struct merge_options *opt,
3037
3026
3038
3027
if (a -> mode != o -> mode )
3039
3028
return 0 ;
3040
- if (oid_eq (& o -> oid , & a -> oid ))
3029
+ if (oideq (& o -> oid , & a -> oid ))
3041
3030
return 1 ;
3042
3031
if (!renormalize )
3043
3032
return 0 ;
@@ -3478,7 +3467,7 @@ static int merge_trees_internal(struct merge_options *opt,
3478
3467
opt -> subtree_shift );
3479
3468
}
3480
3469
3481
- if (oid_eq (& merge_base -> object .oid , & merge -> object .oid )) {
3470
+ if (oideq (& merge_base -> object .oid , & merge -> object .oid )) {
3482
3471
output (opt , 0 , _ ("Already up to date!" ));
3483
3472
* result = head ;
3484
3473
return 1 ;
0 commit comments