@@ -376,7 +376,7 @@ static unsigned long diff_filespec_size(struct diff_filespec *one)
376
376
{
377
377
if (!DIFF_FILE_VALID (one ))
378
378
return 0 ;
379
- diff_populate_filespec (one , 1 );
379
+ diff_populate_filespec (one , CHECK_SIZE_ONLY );
380
380
return one -> size ;
381
381
}
382
382
@@ -1910,11 +1910,11 @@ static void show_dirstat(struct diff_options *options)
1910
1910
diff_free_filespec_data (p -> one );
1911
1911
diff_free_filespec_data (p -> two );
1912
1912
} else if (DIFF_FILE_VALID (p -> one )) {
1913
- diff_populate_filespec (p -> one , 1 );
1913
+ diff_populate_filespec (p -> one , CHECK_SIZE_ONLY );
1914
1914
copied = added = 0 ;
1915
1915
diff_free_filespec_data (p -> one );
1916
1916
} else if (DIFF_FILE_VALID (p -> two )) {
1917
- diff_populate_filespec (p -> two , 1 );
1917
+ diff_populate_filespec (p -> two , CHECK_SIZE_ONLY );
1918
1918
copied = 0 ;
1919
1919
added = p -> two -> size ;
1920
1920
diff_free_filespec_data (p -> two );
@@ -2668,8 +2668,9 @@ static int diff_populate_gitlink(struct diff_filespec *s, int size_only)
2668
2668
* grab the data for the blob (or file) for our own in-core comparison.
2669
2669
* diff_filespec has data and size fields for this purpose.
2670
2670
*/
2671
- int diff_populate_filespec (struct diff_filespec * s , int size_only )
2671
+ int diff_populate_filespec (struct diff_filespec * s , unsigned int flags )
2672
2672
{
2673
+ int size_only = flags & CHECK_SIZE_ONLY ;
2673
2674
int err = 0 ;
2674
2675
/*
2675
2676
* demote FAIL to WARN to allow inspecting the situation
@@ -4688,8 +4689,8 @@ static int diff_filespec_check_stat_unmatch(struct diff_filepair *p)
4688
4689
!DIFF_FILE_VALID (p -> two ) ||
4689
4690
(p -> one -> sha1_valid && p -> two -> sha1_valid ) ||
4690
4691
(p -> one -> mode != p -> two -> mode ) ||
4691
- diff_populate_filespec (p -> one , 1 ) ||
4692
- diff_populate_filespec (p -> two , 1 ) ||
4692
+ diff_populate_filespec (p -> one , CHECK_SIZE_ONLY ) ||
4693
+ diff_populate_filespec (p -> two , CHECK_SIZE_ONLY ) ||
4693
4694
(p -> one -> size != p -> two -> size ) ||
4694
4695
!diff_filespec_is_identical (p -> one , p -> two )) /* (2) */
4695
4696
p -> skip_stat_unmatch_result = 1 ;
0 commit comments