@@ -3154,7 +3154,7 @@ static int apply_binary(struct apply_state *state,
31543154 * See if the old one matches what the patch
31553155 * applies to.
31563156 */
3157- hash_sha1_file (img -> buf , img -> len , blob_type , oid . hash );
3157+ hash_object_file (img -> buf , img -> len , blob_type , & oid );
31583158 if (strcmp (oid_to_hex (& oid ), patch -> old_sha1_prefix ))
31593159 return error (_ ("the patch applies to '%s' (%s), "
31603160 "which does not match the "
@@ -3199,7 +3199,7 @@ static int apply_binary(struct apply_state *state,
31993199 name );
32003200
32013201 /* verify that the result matches */
3202- hash_sha1_file (img -> buf , img -> len , blob_type , oid . hash );
3202+ hash_object_file (img -> buf , img -> len , blob_type , & oid );
32033203 if (strcmp (oid_to_hex (& oid ), patch -> new_sha1_prefix ))
32043204 return error (_ ("binary patch to '%s' creates incorrect result (expecting %s, got %s)" ),
32053205 name , patch -> new_sha1_prefix , oid_to_hex (& oid ));
@@ -3554,7 +3554,7 @@ static int try_threeway(struct apply_state *state,
35543554
35553555 /* Preimage the patch was prepared for */
35563556 if (patch -> is_new )
3557- write_sha1_file ("" , 0 , blob_type , pre_oid . hash );
3557+ write_object_file ("" , 0 , blob_type , & pre_oid );
35583558 else if (get_oid (patch -> old_sha1_prefix , & pre_oid ) ||
35593559 read_blob_object (& buf , & pre_oid , patch -> old_mode ))
35603560 return error (_ ("repository lacks the necessary blob to fall back on 3-way merge." ));
@@ -3570,7 +3570,7 @@ static int try_threeway(struct apply_state *state,
35703570 return -1 ;
35713571 }
35723572 /* post_oid is theirs */
3573- write_sha1_file (tmp_image .buf , tmp_image .len , blob_type , post_oid . hash );
3573+ write_object_file (tmp_image .buf , tmp_image .len , blob_type , & post_oid );
35743574 clear_image (& tmp_image );
35753575
35763576 /* our_oid is ours */
@@ -3583,7 +3583,7 @@ static int try_threeway(struct apply_state *state,
35833583 return error (_ ("cannot read the current contents of '%s'" ),
35843584 patch -> old_name );
35853585 }
3586- write_sha1_file (tmp_image .buf , tmp_image .len , blob_type , our_oid . hash );
3586+ write_object_file (tmp_image .buf , tmp_image .len , blob_type , & our_oid );
35873587 clear_image (& tmp_image );
35883588
35893589 /* in-core three-way merge between post and our using pre as base */
@@ -4291,7 +4291,7 @@ static int add_index_file(struct apply_state *state,
42914291 }
42924292 fill_stat_cache_info (ce , & st );
42934293 }
4294- if (write_sha1_file (buf , size , blob_type , ce -> oid . hash ) < 0 ) {
4294+ if (write_object_file (buf , size , blob_type , & ce -> oid ) < 0 ) {
42954295 free (ce );
42964296 return error (_ ("unable to create backing store "
42974297 "for newly created file %s" ), path );
0 commit comments