@@ -535,7 +535,7 @@ int notes_merge(struct notes_merge_options *o,
535
535
struct notes_tree * local_tree ,
536
536
unsigned char * result_sha1 )
537
537
{
538
- unsigned char local_sha1 [ 20 ], remote_sha1 [ 20 ] ;
538
+ struct object_id local_oid , remote_oid ;
539
539
struct commit * local , * remote ;
540
540
struct commit_list * bases = NULL ;
541
541
const unsigned char * base_sha1 , * base_tree_sha1 ;
@@ -549,46 +549,46 @@ int notes_merge(struct notes_merge_options *o,
549
549
o -> local_ref , o -> remote_ref );
550
550
551
551
/* Dereference o->local_ref into local_sha1 */
552
- if (read_ref_full (o -> local_ref , 0 , local_sha1 , NULL ))
552
+ if (read_ref_full (o -> local_ref , 0 , local_oid . hash , NULL ))
553
553
die ("Failed to resolve local notes ref '%s'" , o -> local_ref );
554
554
else if (!check_refname_format (o -> local_ref , 0 ) &&
555
- is_null_sha1 ( local_sha1 ))
555
+ is_null_oid ( & local_oid ))
556
556
local = NULL ; /* local_sha1 == null_sha1 indicates unborn ref */
557
- else if (!(local = lookup_commit_reference (local_sha1 )))
557
+ else if (!(local = lookup_commit_reference (local_oid . hash )))
558
558
die ("Could not parse local commit %s (%s)" ,
559
- sha1_to_hex ( local_sha1 ), o -> local_ref );
560
- trace_printf ("\tlocal commit: %.7s\n" , sha1_to_hex ( local_sha1 ));
559
+ oid_to_hex ( & local_oid ), o -> local_ref );
560
+ trace_printf ("\tlocal commit: %.7s\n" , oid_to_hex ( & local_oid ));
561
561
562
562
/* Dereference o->remote_ref into remote_sha1 */
563
- if (get_sha1 (o -> remote_ref , remote_sha1 )) {
563
+ if (get_oid (o -> remote_ref , & remote_oid )) {
564
564
/*
565
565
* Failed to get remote_sha1. If o->remote_ref looks like an
566
566
* unborn ref, perform the merge using an empty notes tree.
567
567
*/
568
568
if (!check_refname_format (o -> remote_ref , 0 )) {
569
- hashclr ( remote_sha1 );
569
+ oidclr ( & remote_oid );
570
570
remote = NULL ;
571
571
} else {
572
572
die ("Failed to resolve remote notes ref '%s'" ,
573
573
o -> remote_ref );
574
574
}
575
- } else if (!(remote = lookup_commit_reference (remote_sha1 ))) {
575
+ } else if (!(remote = lookup_commit_reference (remote_oid . hash ))) {
576
576
die ("Could not parse remote commit %s (%s)" ,
577
- sha1_to_hex ( remote_sha1 ), o -> remote_ref );
577
+ oid_to_hex ( & remote_oid ), o -> remote_ref );
578
578
}
579
- trace_printf ("\tremote commit: %.7s\n" , sha1_to_hex ( remote_sha1 ));
579
+ trace_printf ("\tremote commit: %.7s\n" , oid_to_hex ( & remote_oid ));
580
580
581
581
if (!local && !remote )
582
582
die ("Cannot merge empty notes ref (%s) into empty notes ref "
583
583
"(%s)" , o -> remote_ref , o -> local_ref );
584
584
if (!local ) {
585
585
/* result == remote commit */
586
- hashcpy (result_sha1 , remote_sha1 );
586
+ hashcpy (result_sha1 , remote_oid . hash );
587
587
goto found_result ;
588
588
}
589
589
if (!remote ) {
590
590
/* result == local commit */
591
- hashcpy (result_sha1 , local_sha1 );
591
+ hashcpy (result_sha1 , local_oid . hash );
592
592
goto found_result ;
593
593
}
594
594
assert (local && remote );
0 commit comments