@@ -588,7 +588,7 @@ static void write_remote_refs(const struct ref *local_refs)
588588 for (r = local_refs ; r ; r = r -> next ) {
589589 if (!r -> peer_ref )
590590 continue ;
591- if (ref_transaction_create (t , r -> peer_ref -> name , r -> old_oid . hash ,
591+ if (ref_transaction_create (t , r -> peer_ref -> name , & r -> old_oid ,
592592 0 , NULL , & err ))
593593 die ("%s" , err .buf );
594594 }
@@ -610,12 +610,12 @@ static void write_followtags(const struct ref *refs, const char *msg)
610610 continue ;
611611 if (!has_object_file (& ref -> old_oid ))
612612 continue ;
613- update_ref (msg , ref -> name , ref -> old_oid . hash ,
614- NULL , 0 , UPDATE_REFS_DIE_ON_ERR );
613+ update_ref (msg , ref -> name , & ref -> old_oid , NULL , 0 ,
614+ UPDATE_REFS_DIE_ON_ERR );
615615 }
616616}
617617
618- static int iterate_ref_map (void * cb_data , unsigned char sha1 [ 20 ] )
618+ static int iterate_ref_map (void * cb_data , struct object_id * oid )
619619{
620620 struct ref * * rm = cb_data ;
621621 struct ref * ref = * rm ;
@@ -630,7 +630,7 @@ static int iterate_ref_map(void *cb_data, unsigned char sha1[20])
630630 if (!ref )
631631 return -1 ;
632632
633- hashcpy ( sha1 , ref -> old_oid . hash );
633+ oidcpy ( oid , & ref -> old_oid );
634634 * rm = ref -> next ;
635635 return 0 ;
636636}
@@ -682,23 +682,23 @@ static void update_head(const struct ref *our, const struct ref *remote,
682682 if (create_symref ("HEAD" , our -> name , NULL ) < 0 )
683683 die (_ ("unable to update HEAD" ));
684684 if (!option_bare ) {
685- update_ref (msg , "HEAD" , our -> old_oid . hash , NULL , 0 ,
685+ update_ref (msg , "HEAD" , & our -> old_oid , NULL , 0 ,
686686 UPDATE_REFS_DIE_ON_ERR );
687687 install_branch_config (0 , head , option_origin , our -> name );
688688 }
689689 } else if (our ) {
690690 struct commit * c = lookup_commit_reference (& our -> old_oid );
691691 /* --branch specifies a non-branch (i.e. tags), detach HEAD */
692- update_ref (msg , "HEAD" , c -> object .oid . hash ,
693- NULL , REF_NODEREF , UPDATE_REFS_DIE_ON_ERR );
692+ update_ref (msg , "HEAD" , & c -> object .oid , NULL , REF_NODEREF ,
693+ UPDATE_REFS_DIE_ON_ERR );
694694 } else if (remote ) {
695695 /*
696696 * We know remote HEAD points to a non-branch, or
697697 * HEAD points to a branch but we don't know which one.
698698 * Detach HEAD in all these cases.
699699 */
700- update_ref (msg , "HEAD" , remote -> old_oid . hash ,
701- NULL , REF_NODEREF , UPDATE_REFS_DIE_ON_ERR );
700+ update_ref (msg , "HEAD" , & remote -> old_oid , NULL , REF_NODEREF ,
701+ UPDATE_REFS_DIE_ON_ERR );
702702 }
703703}
704704
@@ -715,7 +715,7 @@ static int checkout(int submodule_progress)
715715 if (option_no_checkout )
716716 return 0 ;
717717
718- head = resolve_refdup ("HEAD" , RESOLVE_REF_READING , oid . hash , NULL );
718+ head = resolve_refdup ("HEAD" , RESOLVE_REF_READING , & oid , NULL );
719719 if (!head ) {
720720 warning (_ ("remote HEAD refers to nonexistent ref, "
721721 "unable to checkout.\n" ));
0 commit comments