@@ -506,7 +506,7 @@ static int fill_blob_sha1_and_mode(struct origin *origin)
506
506
{
507
507
if (!is_null_sha1 (origin -> blob_sha1 ))
508
508
return 0 ;
509
- if (get_tree_entry (origin -> commit -> object .sha1 ,
509
+ if (get_tree_entry (origin -> commit -> object .oid . hash ,
510
510
origin -> path ,
511
511
origin -> blob_sha1 , & origin -> mode ))
512
512
goto error_out ;
@@ -557,11 +557,11 @@ static struct origin *find_origin(struct scoreboard *sb,
557
557
PATHSPEC_LITERAL_PATH , "" , paths );
558
558
diff_setup_done (& diff_opts );
559
559
560
- if (is_null_sha1 ( origin -> commit -> object .sha1 ))
561
- do_diff_cache (parent -> tree -> object .sha1 , & diff_opts );
560
+ if (is_null_oid ( & origin -> commit -> object .oid ))
561
+ do_diff_cache (parent -> tree -> object .oid . hash , & diff_opts );
562
562
else
563
- diff_tree_sha1 (parent -> tree -> object .sha1 ,
564
- origin -> commit -> tree -> object .sha1 ,
563
+ diff_tree_sha1 (parent -> tree -> object .oid . hash ,
564
+ origin -> commit -> tree -> object .oid . hash ,
565
565
"" , & diff_opts );
566
566
diffcore_std (& diff_opts );
567
567
@@ -627,11 +627,11 @@ static struct origin *find_rename(struct scoreboard *sb,
627
627
diff_opts .single_follow = origin -> path ;
628
628
diff_setup_done (& diff_opts );
629
629
630
- if (is_null_sha1 ( origin -> commit -> object .sha1 ))
631
- do_diff_cache (parent -> tree -> object .sha1 , & diff_opts );
630
+ if (is_null_oid ( & origin -> commit -> object .oid ))
631
+ do_diff_cache (parent -> tree -> object .oid . hash , & diff_opts );
632
632
else
633
- diff_tree_sha1 (parent -> tree -> object .sha1 ,
634
- origin -> commit -> tree -> object .sha1 ,
633
+ diff_tree_sha1 (parent -> tree -> object .oid . hash ,
634
+ origin -> commit -> tree -> object .oid . hash ,
635
635
"" , & diff_opts );
636
636
diffcore_std (& diff_opts );
637
637
@@ -977,8 +977,8 @@ static void pass_blame_to_parent(struct scoreboard *sb,
977
977
978
978
if (diff_hunks (& file_p , & file_o , 0 , blame_chunk_cb , & d ))
979
979
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 ));
982
982
/* The rest are the same as the parent */
983
983
blame_chunk (& d .dstq , & d .srcq , INT_MAX , d .offset , INT_MAX , parent );
984
984
* d .dstq = NULL ;
@@ -1126,7 +1126,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
1126
1126
memset (split , 0 , sizeof (struct blame_entry [3 ]));
1127
1127
if (diff_hunks (file_p , & file_o , 1 , handle_split_cb , & d ))
1128
1128
die ("unable to generate diff (%s)" ,
1129
- sha1_to_hex ( parent -> commit -> object .sha1 ));
1129
+ oid_to_hex ( & parent -> commit -> object .oid ));
1130
1130
/* remainder, if any, all match the preimage */
1131
1131
handle_split (sb , ent , d .tlno , d .plno , ent -> num_lines , parent , split );
1132
1132
}
@@ -1275,11 +1275,11 @@ static void find_copy_in_parent(struct scoreboard *sb,
1275
1275
&& (!porigin || strcmp (target -> path , porigin -> path ))))
1276
1276
DIFF_OPT_SET (& diff_opts , FIND_COPIES_HARDER );
1277
1277
1278
- if (is_null_sha1 ( target -> commit -> object .sha1 ))
1279
- do_diff_cache (parent -> tree -> object .sha1 , & diff_opts );
1278
+ if (is_null_oid ( & target -> commit -> object .oid ))
1279
+ do_diff_cache (parent -> tree -> object .oid . hash , & diff_opts );
1280
1280
else
1281
- diff_tree_sha1 (parent -> tree -> object .sha1 ,
1282
- target -> commit -> tree -> object .sha1 ,
1281
+ diff_tree_sha1 (parent -> tree -> object .oid . hash ,
1282
+ target -> commit -> tree -> object .oid . hash ,
1283
1283
"" , & diff_opts );
1284
1284
1285
1285
if (!DIFF_OPT_TST (& diff_opts , FIND_COPIES_HARDER ))
@@ -1690,7 +1690,7 @@ static void get_commit_info(struct commit *commit,
1690
1690
if (len )
1691
1691
strbuf_add (& ret -> summary , subject , len );
1692
1692
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 ));
1694
1694
1695
1695
unuse_commit_buffer (commit , message );
1696
1696
}
@@ -1733,7 +1733,7 @@ static int emit_one_suspect_detail(struct origin *suspect, int repeat)
1733
1733
printf ("boundary\n" );
1734
1734
if (suspect -> previous ) {
1735
1735
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 ));
1737
1737
write_name_quoted (prev -> path , stdout , '\n' );
1738
1738
}
1739
1739
@@ -1752,7 +1752,7 @@ static void found_guilty_entry(struct blame_entry *ent)
1752
1752
struct origin * suspect = ent -> suspect ;
1753
1753
1754
1754
printf ("%s %d %d %d\n" ,
1755
- sha1_to_hex ( suspect -> commit -> object .sha1 ),
1755
+ oid_to_hex ( & suspect -> commit -> object .oid ),
1756
1756
ent -> s_lno + 1 , ent -> lno + 1 , ent -> num_lines );
1757
1757
emit_one_suspect_detail (suspect , 0 );
1758
1758
write_filename_info (suspect -> path );
@@ -1882,7 +1882,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
1882
1882
struct origin * suspect = ent -> suspect ;
1883
1883
char hex [GIT_SHA1_HEXSZ + 1 ];
1884
1884
1885
- sha1_to_hex_r (hex , suspect -> commit -> object .sha1 );
1885
+ sha1_to_hex_r (hex , suspect -> commit -> object .oid . hash );
1886
1886
printf ("%s %d %d %d\n" ,
1887
1887
hex ,
1888
1888
ent -> s_lno + 1 ,
@@ -1922,7 +1922,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
1922
1922
int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP );
1923
1923
1924
1924
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 );
1926
1926
1927
1927
cp = nth_line (sb , ent -> lno );
1928
1928
for (cnt = 0 ; cnt < ent -> num_lines ; cnt ++ ) {
@@ -2077,7 +2077,7 @@ static int read_ancestry(const char *graft_file)
2077
2077
2078
2078
static int update_auto_abbrev (int auto_abbrev , struct origin * suspect )
2079
2079
{
2080
- const char * uniq = find_unique_abbrev (suspect -> commit -> object .sha1 ,
2080
+ const char * uniq = find_unique_abbrev (suspect -> commit -> object .oid . hash ,
2081
2081
auto_abbrev );
2082
2082
int len = strlen (uniq );
2083
2083
if (auto_abbrev < len )
@@ -2153,7 +2153,7 @@ static void sanity_check_refcnt(struct scoreboard *sb)
2153
2153
if (ent -> suspect -> refcnt <= 0 ) {
2154
2154
fprintf (stderr , "%s in %s has negative refcnt %d\n" ,
2155
2155
ent -> suspect -> path ,
2156
- sha1_to_hex ( ent -> suspect -> commit -> object .sha1 ),
2156
+ oid_to_hex ( & ent -> suspect -> commit -> object .oid ),
2157
2157
ent -> suspect -> refcnt );
2158
2158
baa = 1 ;
2159
2159
}
@@ -2216,7 +2216,7 @@ static void verify_working_tree_path(struct commit *work_tree, const char *path)
2216
2216
struct commit_list * parents ;
2217
2217
2218
2218
for (parents = work_tree -> parents ; parents ; parents = parents -> next ) {
2219
- const unsigned char * commit_sha1 = parents -> item -> object .sha1 ;
2219
+ const unsigned char * commit_sha1 = parents -> item -> object .oid . hash ;
2220
2220
unsigned char blob_sha1 [20 ];
2221
2221
unsigned mode ;
2222
2222
@@ -2310,7 +2310,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
2310
2310
strbuf_addstr (& msg , "tree 0000000000000000000000000000000000000000\n" );
2311
2311
for (parent = commit -> parents ; parent ; parent = parent -> next )
2312
2312
strbuf_addf (& msg , "parent %s\n" ,
2313
- sha1_to_hex ( parent -> item -> object .sha1 ));
2313
+ oid_to_hex ( & parent -> item -> object .oid ));
2314
2314
strbuf_addf (& msg ,
2315
2315
"author %s\n"
2316
2316
"committer %s\n\n"
@@ -2738,7 +2738,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2738
2738
2739
2739
sb .revs -> children .name = "children" ;
2740
2740
while (c -> parents &&
2741
- hashcmp ( c -> object .sha1 , sb .final -> object .sha1 )) {
2741
+ oidcmp ( & c -> object .oid , & sb .final -> object .oid )) {
2742
2742
struct commit_list * l = xcalloc (1 , sizeof (* l ));
2743
2743
2744
2744
l -> item = c ;
@@ -2748,11 +2748,11 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2748
2748
c = c -> parents -> item ;
2749
2749
}
2750
2750
2751
- if (hashcmp ( c -> object .sha1 , sb .final -> object .sha1 ))
2751
+ if (oidcmp ( & c -> object .oid , & sb .final -> object .oid ))
2752
2752
die ("--reverse --first-parent together require range along first-parent chain" );
2753
2753
}
2754
2754
2755
- if (is_null_sha1 ( sb .final -> object .sha1 )) {
2755
+ if (is_null_oid ( & sb .final -> object .oid )) {
2756
2756
o = sb .final -> util ;
2757
2757
sb .final_buf = xmemdupz (o -> file .ptr , o -> file .size );
2758
2758
sb .final_buf_size = o -> file .size ;
0 commit comments