@@ -535,7 +535,7 @@ int notes_merge(struct notes_merge_options *o,
535535 struct notes_tree * local_tree ,
536536 unsigned char * result_sha1 )
537537{
538- unsigned char local_sha1 [ 20 ], remote_sha1 [ 20 ] ;
538+ struct object_id local_oid , remote_oid ;
539539 struct commit * local , * remote ;
540540 struct commit_list * bases = NULL ;
541541 const unsigned char * base_sha1 , * base_tree_sha1 ;
@@ -549,46 +549,46 @@ int notes_merge(struct notes_merge_options *o,
549549 o -> local_ref , o -> remote_ref );
550550
551551 /* 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 ))
553553 die ("Failed to resolve local notes ref '%s'" , o -> local_ref );
554554 else if (!check_refname_format (o -> local_ref , 0 ) &&
555- is_null_sha1 ( local_sha1 ))
555+ is_null_oid ( & local_oid ))
556556 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 )))
558558 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 ));
561561
562562 /* 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 )) {
564564 /*
565565 * Failed to get remote_sha1. If o->remote_ref looks like an
566566 * unborn ref, perform the merge using an empty notes tree.
567567 */
568568 if (!check_refname_format (o -> remote_ref , 0 )) {
569- hashclr ( remote_sha1 );
569+ oidclr ( & remote_oid );
570570 remote = NULL ;
571571 } else {
572572 die ("Failed to resolve remote notes ref '%s'" ,
573573 o -> remote_ref );
574574 }
575- } else if (!(remote = lookup_commit_reference (remote_sha1 ))) {
575+ } else if (!(remote = lookup_commit_reference (remote_oid . hash ))) {
576576 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 );
578578 }
579- trace_printf ("\tremote commit: %.7s\n" , sha1_to_hex ( remote_sha1 ));
579+ trace_printf ("\tremote commit: %.7s\n" , oid_to_hex ( & remote_oid ));
580580
581581 if (!local && !remote )
582582 die ("Cannot merge empty notes ref (%s) into empty notes ref "
583583 "(%s)" , o -> remote_ref , o -> local_ref );
584584 if (!local ) {
585585 /* result == remote commit */
586- hashcpy (result_sha1 , remote_sha1 );
586+ hashcpy (result_sha1 , remote_oid . hash );
587587 goto found_result ;
588588 }
589589 if (!remote ) {
590590 /* result == local commit */
591- hashcpy (result_sha1 , local_sha1 );
591+ hashcpy (result_sha1 , local_oid . hash );
592592 goto found_result ;
593593 }
594594 assert (local && remote );
0 commit comments