@@ -557,7 +557,7 @@ static struct origin *find_origin(struct scoreboard *sb,
557557 PATHSPEC_LITERAL_PATH , "" , paths );
558558 diff_setup_done (& diff_opts );
559559
560- if (is_null_sha1 ( origin -> commit -> object .sha1 ))
560+ if (is_null_oid ( & origin -> commit -> object .oid ))
561561 do_diff_cache (get_object_hash (parent -> tree -> object ), & diff_opts );
562562 else
563563 diff_tree_sha1 (get_object_hash (parent -> tree -> object ),
@@ -627,7 +627,7 @@ static struct origin *find_rename(struct scoreboard *sb,
627627 diff_opts .single_follow = origin -> path ;
628628 diff_setup_done (& diff_opts );
629629
630- if (is_null_sha1 ( origin -> commit -> object .sha1 ))
630+ if (is_null_oid ( & origin -> commit -> object .oid ))
631631 do_diff_cache (get_object_hash (parent -> tree -> object ), & diff_opts );
632632 else
633633 diff_tree_sha1 (get_object_hash (parent -> tree -> object ),
@@ -977,8 +977,8 @@ static void pass_blame_to_parent(struct scoreboard *sb,
977977
978978 if (diff_hunks (& file_p , & file_o , 0 , blame_chunk_cb , & d ))
979979 die ("unable to generate diff (%s -> %s)" ,
980- sha1_to_hex ( parent -> commit -> object .sha1 ),
981- sha1_to_hex ( target -> commit -> object .sha1 ));
980+ oid_to_hex ( & parent -> commit -> object .oid ),
981+ oid_to_hex ( & target -> commit -> object .oid ));
982982 /* The rest are the same as the parent */
983983 blame_chunk (& d .dstq , & d .srcq , INT_MAX , d .offset , INT_MAX , parent );
984984 * d .dstq = NULL ;
@@ -1126,7 +1126,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
11261126 memset (split , 0 , sizeof (struct blame_entry [3 ]));
11271127 if (diff_hunks (file_p , & file_o , 1 , handle_split_cb , & d ))
11281128 die ("unable to generate diff (%s)" ,
1129- sha1_to_hex ( parent -> commit -> object .sha1 ));
1129+ oid_to_hex ( & parent -> commit -> object .oid ));
11301130 /* remainder, if any, all match the preimage */
11311131 handle_split (sb , ent , d .tlno , d .plno , ent -> num_lines , parent , split );
11321132}
@@ -1275,7 +1275,7 @@ static void find_copy_in_parent(struct scoreboard *sb,
12751275 && (!porigin || strcmp (target -> path , porigin -> path ))))
12761276 DIFF_OPT_SET (& diff_opts , FIND_COPIES_HARDER );
12771277
1278- if (is_null_sha1 ( target -> commit -> object .sha1 ))
1278+ if (is_null_oid ( & target -> commit -> object .oid ))
12791279 do_diff_cache (get_object_hash (parent -> tree -> object ), & diff_opts );
12801280 else
12811281 diff_tree_sha1 (get_object_hash (parent -> tree -> object ),
@@ -1690,7 +1690,7 @@ static void get_commit_info(struct commit *commit,
16901690 if (len )
16911691 strbuf_add (& ret -> summary , subject , len );
16921692 else
1693- strbuf_addf (& ret -> summary , "(%s)" , sha1_to_hex ( commit -> object .sha1 ));
1693+ strbuf_addf (& ret -> summary , "(%s)" , oid_to_hex ( & commit -> object .oid ));
16941694
16951695 unuse_commit_buffer (commit , message );
16961696}
@@ -1733,7 +1733,7 @@ static int emit_one_suspect_detail(struct origin *suspect, int repeat)
17331733 printf ("boundary\n" );
17341734 if (suspect -> previous ) {
17351735 struct origin * prev = suspect -> previous ;
1736- printf ("previous %s " , sha1_to_hex ( prev -> commit -> object .sha1 ));
1736+ printf ("previous %s " , oid_to_hex ( & prev -> commit -> object .oid ));
17371737 write_name_quoted (prev -> path , stdout , '\n' );
17381738 }
17391739
@@ -1752,7 +1752,7 @@ static void found_guilty_entry(struct blame_entry *ent)
17521752 struct origin * suspect = ent -> suspect ;
17531753
17541754 printf ("%s %d %d %d\n" ,
1755- sha1_to_hex ( suspect -> commit -> object .sha1 ),
1755+ oid_to_hex ( & suspect -> commit -> object .oid ),
17561756 ent -> s_lno + 1 , ent -> lno + 1 , ent -> num_lines );
17571757 emit_one_suspect_detail (suspect , 0 );
17581758 write_filename_info (suspect -> path );
@@ -1882,7 +1882,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
18821882 struct origin * suspect = ent -> suspect ;
18831883 char hex [GIT_SHA1_HEXSZ + 1 ];
18841884
1885- sha1_to_hex_r (hex , suspect -> commit -> object .sha1 );
1885+ sha1_to_hex_r (hex , suspect -> commit -> object .oid . hash );
18861886 printf ("%s %d %d %d\n" ,
18871887 hex ,
18881888 ent -> s_lno + 1 ,
@@ -1922,7 +1922,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
19221922 int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP );
19231923
19241924 get_commit_info (suspect -> commit , & ci , 1 );
1925- sha1_to_hex_r (hex , suspect -> commit -> object .sha1 );
1925+ sha1_to_hex_r (hex , suspect -> commit -> object .oid . hash );
19261926
19271927 cp = nth_line (sb , ent -> lno );
19281928 for (cnt = 0 ; cnt < ent -> num_lines ; cnt ++ ) {
@@ -2153,7 +2153,7 @@ static void sanity_check_refcnt(struct scoreboard *sb)
21532153 if (ent -> suspect -> refcnt <= 0 ) {
21542154 fprintf (stderr , "%s in %s has negative refcnt %d\n" ,
21552155 ent -> suspect -> path ,
2156- sha1_to_hex ( ent -> suspect -> commit -> object .sha1 ),
2156+ oid_to_hex ( & ent -> suspect -> commit -> object .oid ),
21572157 ent -> suspect -> refcnt );
21582158 baa = 1 ;
21592159 }
@@ -2310,7 +2310,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
23102310 strbuf_addstr (& msg , "tree 0000000000000000000000000000000000000000\n" );
23112311 for (parent = commit -> parents ; parent ; parent = parent -> next )
23122312 strbuf_addf (& msg , "parent %s\n" ,
2313- sha1_to_hex ( parent -> item -> object .sha1 ));
2313+ oid_to_hex ( & parent -> item -> object .oid ));
23142314 strbuf_addf (& msg ,
23152315 "author %s\n"
23162316 "committer %s\n\n"
@@ -2740,7 +2740,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
27402740
27412741 sb .revs -> children .name = "children" ;
27422742 while (c -> parents &&
2743- hashcmp ( c -> object .sha1 , sb .final -> object .sha1 )) {
2743+ oidcmp ( & c -> object .oid , & sb .final -> object .oid )) {
27442744 struct commit_list * l = xcalloc (1 , sizeof (* l ));
27452745
27462746 l -> item = c ;
@@ -2750,11 +2750,11 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
27502750 c = c -> parents -> item ;
27512751 }
27522752
2753- if (hashcmp ( c -> object .sha1 , sb .final -> object .sha1 ))
2753+ if (oidcmp ( & c -> object .oid , & sb .final -> object .oid ))
27542754 die ("--reverse --first-parent together require range along first-parent chain" );
27552755 }
27562756
2757- if (is_null_sha1 ( sb .final -> object .sha1 )) {
2757+ if (is_null_oid ( & sb .final -> object .oid )) {
27582758 o = sb .final -> util ;
27592759 sb .final_buf = xmemdupz (o -> file .ptr , o -> file .size );
27602760 sb .final_buf_size = o -> file .size ;
0 commit comments