@@ -374,23 +374,23 @@ static void update_abort_safety_file(void)
374374 write_file (git_path_abort_safety_file (), "%s" , "" );
375375}
376376
377- static int fast_forward_to (const unsigned char * to , const unsigned char * from ,
377+ static int fast_forward_to (const struct object_id * to , const struct object_id * from ,
378378 int unborn , struct replay_opts * opts )
379379{
380380 struct ref_transaction * transaction ;
381381 struct strbuf sb = STRBUF_INIT ;
382382 struct strbuf err = STRBUF_INIT ;
383383
384384 read_cache ();
385- if (checkout_fast_forward (from , to , 1 ))
385+ if (checkout_fast_forward (from -> hash , to -> hash , 1 ))
386386 return -1 ; /* the callee should have complained already */
387387
388388 strbuf_addf (& sb , _ ("%s: fast-forward" ), _ (action_name (opts )));
389389
390390 transaction = ref_transaction_begin (& err );
391391 if (!transaction ||
392392 ref_transaction_update (transaction , "HEAD" ,
393- to , unborn ? null_sha1 : from ,
393+ to -> hash , unborn ? null_sha1 : from -> hash ,
394394 0 , sb .buf , & err ) ||
395395 ref_transaction_commit (transaction , & err )) {
396396 ref_transaction_free (transaction );
@@ -935,7 +935,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
935935{
936936 unsigned int flags = opts -> edit ? EDIT_MSG : 0 ;
937937 const char * msg_file = opts -> edit ? NULL : git_path_merge_msg ();
938- unsigned char head [ 20 ] ;
938+ struct object_id head ;
939939 struct commit * base , * next , * parent ;
940940 const char * base_label , * next_label ;
941941 struct commit_message msg = { NULL , NULL , NULL , NULL };
@@ -949,12 +949,12 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
949949 * that represents the "current" state for merge-recursive
950950 * to work on.
951951 */
952- if (write_cache_as_tree (head , 0 , NULL ))
952+ if (write_cache_as_tree (head . hash , 0 , NULL ))
953953 return error (_ ("your index file is unmerged." ));
954954 } else {
955- unborn = get_sha1 ("HEAD" , head );
955+ unborn = get_oid ("HEAD" , & head );
956956 if (unborn )
957- hashcpy ( head , EMPTY_TREE_SHA1_BIN );
957+ oidcpy ( & head , & empty_tree_oid );
958958 if (index_differs_from (unborn ? EMPTY_TREE_SHA1_HEX : "HEAD" , 0 , 0 ))
959959 return error_dirty_index (opts );
960960 }
@@ -990,11 +990,11 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
990990 oid_to_hex (& commit -> object .oid ));
991991
992992 if (opts -> allow_ff && !is_fixup (command ) &&
993- ((parent && !hashcmp ( parent -> object .oid . hash , head )) ||
993+ ((parent && !oidcmp ( & parent -> object .oid , & head )) ||
994994 (!parent && unborn ))) {
995995 if (is_rebase_i (opts ))
996996 write_author_script (msg .message );
997- res = fast_forward_to (commit -> object .oid . hash , head , unborn ,
997+ res = fast_forward_to (& commit -> object .oid , & head , unborn ,
998998 opts );
999999 if (res || command != TODO_REWORD )
10001000 goto leave ;
@@ -1081,7 +1081,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
10811081 res = -1 ;
10821082 else if (!opts -> strategy || !strcmp (opts -> strategy , "recursive" ) || command == TODO_REVERT ) {
10831083 res = do_recursive_merge (base , next , base_label , next_label ,
1084- head , & msgbuf , opts );
1084+ head . hash , & msgbuf , opts );
10851085 if (res < 0 )
10861086 return res ;
10871087 res |= write_message (msgbuf .buf , msgbuf .len ,
@@ -1097,7 +1097,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
10971097 commit_list_insert (next , & remotes );
10981098 res |= try_merge_command (opts -> strategy ,
10991099 opts -> xopts_nr , (const char * * )opts -> xopts ,
1100- common , sha1_to_hex ( head ), remotes );
1100+ common , oid_to_hex ( & head ), remotes );
11011101 free_commit_list (common );
11021102 free_commit_list (remotes );
11031103 }
0 commit comments