@@ -1933,7 +1933,7 @@ static void show_dirstat(struct diff_options *options)
19331933
19341934 name = p -> two -> path ? p -> two -> path : p -> one -> path ;
19351935
1936- if (p -> one -> sha1_valid && p -> two -> sha1_valid )
1936+ if (p -> one -> oid_valid && p -> two -> oid_valid )
19371937 content_changed = oidcmp (& p -> one -> oid , & p -> two -> oid );
19381938 else
19391939 content_changed = 1 ;
@@ -2640,7 +2640,7 @@ void fill_filespec(struct diff_filespec *spec, const unsigned char *sha1,
26402640 if (mode ) {
26412641 spec -> mode = canon_mode (mode );
26422642 hashcpy (spec -> oid .hash , sha1 );
2643- spec -> sha1_valid = sha1_valid ;
2643+ spec -> oid_valid = sha1_valid ;
26442644 }
26452645}
26462646
@@ -2766,7 +2766,7 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
27662766 if (S_ISGITLINK (s -> mode ))
27672767 return diff_populate_gitlink (s , size_only );
27682768
2769- if (!s -> sha1_valid ||
2769+ if (!s -> oid_valid ||
27702770 reuse_worktree_file (s -> path , s -> oid .hash , 0 )) {
27712771 struct strbuf buf = STRBUF_INIT ;
27722772 struct stat st ;
@@ -2915,7 +2915,7 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
29152915 }
29162916
29172917 if (!S_ISGITLINK (one -> mode ) &&
2918- (!one -> sha1_valid ||
2918+ (!one -> oid_valid ||
29192919 reuse_worktree_file (name , one -> oid .hash , 1 ))) {
29202920 struct stat st ;
29212921 if (lstat (name , & st ) < 0 ) {
@@ -2928,16 +2928,16 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
29282928 if (strbuf_readlink (& sb , name , st .st_size ) < 0 )
29292929 die_errno ("readlink(%s)" , name );
29302930 prep_temp_blob (name , temp , sb .buf , sb .len ,
2931- (one -> sha1_valid ?
2931+ (one -> oid_valid ?
29322932 one -> oid .hash : null_sha1 ),
2933- (one -> sha1_valid ?
2933+ (one -> oid_valid ?
29342934 one -> mode : S_IFLNK ));
29352935 strbuf_release (& sb );
29362936 }
29372937 else {
29382938 /* we can borrow from the file in the work tree */
29392939 temp -> name = name ;
2940- if (!one -> sha1_valid )
2940+ if (!one -> oid_valid )
29412941 sha1_to_hex_r (temp -> hex , null_sha1 );
29422942 else
29432943 sha1_to_hex_r (temp -> hex , one -> oid .hash );
@@ -3134,7 +3134,7 @@ static void run_diff_cmd(const char *pgm,
31343134static void diff_fill_sha1_info (struct diff_filespec * one )
31353135{
31363136 if (DIFF_FILE_VALID (one )) {
3137- if (!one -> sha1_valid ) {
3137+ if (!one -> oid_valid ) {
31383138 struct stat st ;
31393139 if (one -> is_stdin ) {
31403140 oidclr (& one -> oid );
@@ -4172,11 +4172,11 @@ int diff_unmodified_pair(struct diff_filepair *p)
41724172 /* both are valid and point at the same path. that is, we are
41734173 * dealing with a change.
41744174 */
4175- if (one -> sha1_valid && two -> sha1_valid &&
4175+ if (one -> oid_valid && two -> oid_valid &&
41764176 !oidcmp (& one -> oid , & two -> oid ) &&
41774177 !one -> dirty_submodule && !two -> dirty_submodule )
41784178 return 1 ; /* no change */
4179- if (!one -> sha1_valid && !two -> sha1_valid )
4179+ if (!one -> oid_valid && !two -> oid_valid )
41804180 return 1 ; /* both look at the same file on the filesystem. */
41814181 return 0 ;
41824182}
@@ -4237,7 +4237,7 @@ void diff_debug_filespec(struct diff_filespec *s, int x, const char *one)
42374237 s -> path ,
42384238 DIFF_FILE_VALID (s ) ? "valid" : "invalid" ,
42394239 s -> mode ,
4240- s -> sha1_valid ? oid_to_hex (& s -> oid ) : "" );
4240+ s -> oid_valid ? oid_to_hex (& s -> oid ) : "" );
42414241 fprintf (stderr , "queue[%d] %s size %lu\n" ,
42424242 x , one ? one : "" ,
42434243 s -> size );
@@ -4822,7 +4822,7 @@ static int diff_filespec_check_stat_unmatch(struct diff_filepair *p)
48224822 */
48234823 if (!DIFF_FILE_VALID (p -> one ) || /* (1) */
48244824 !DIFF_FILE_VALID (p -> two ) ||
4825- (p -> one -> sha1_valid && p -> two -> sha1_valid ) ||
4825+ (p -> one -> oid_valid && p -> two -> oid_valid ) ||
48264826 (p -> one -> mode != p -> two -> mode ) ||
48274827 diff_populate_filespec (p -> one , CHECK_SIZE_ONLY ) ||
48284828 diff_populate_filespec (p -> two , CHECK_SIZE_ONLY ) ||
@@ -5118,7 +5118,7 @@ size_t fill_textconv(struct userdiff_driver *driver,
51185118 if (!driver -> textconv )
51195119 die ("BUG: fill_textconv called with non-textconv driver" );
51205120
5121- if (driver -> textconv_cache && df -> sha1_valid ) {
5121+ if (driver -> textconv_cache && df -> oid_valid ) {
51225122 * outbuf = notes_cache_get (driver -> textconv_cache ,
51235123 df -> oid .hash ,
51245124 & size );
@@ -5130,7 +5130,7 @@ size_t fill_textconv(struct userdiff_driver *driver,
51305130 if (!* outbuf )
51315131 die ("unable to read files to diff" );
51325132
5133- if (driver -> textconv_cache && df -> sha1_valid ) {
5133+ if (driver -> textconv_cache && df -> oid_valid ) {
51345134 /* ignore errors, as we might be in a readonly repository */
51355135 notes_cache_put (driver -> textconv_cache , df -> oid .hash , * outbuf ,
51365136 size );
0 commit comments