@@ -376,7 +376,7 @@ static unsigned long diff_filespec_size(struct diff_filespec *one)
376376{
377377 if (!DIFF_FILE_VALID (one ))
378378 return 0 ;
379- diff_populate_filespec (one , 1 );
379+ diff_populate_filespec (one , CHECK_SIZE_ONLY );
380380 return one -> size ;
381381}
382382
@@ -1910,11 +1910,11 @@ static void show_dirstat(struct diff_options *options)
19101910 diff_free_filespec_data (p -> one );
19111911 diff_free_filespec_data (p -> two );
19121912 } else if (DIFF_FILE_VALID (p -> one )) {
1913- diff_populate_filespec (p -> one , 1 );
1913+ diff_populate_filespec (p -> one , CHECK_SIZE_ONLY );
19141914 copied = added = 0 ;
19151915 diff_free_filespec_data (p -> one );
19161916 } else if (DIFF_FILE_VALID (p -> two )) {
1917- diff_populate_filespec (p -> two , 1 );
1917+ diff_populate_filespec (p -> two , CHECK_SIZE_ONLY );
19181918 copied = 0 ;
19191919 added = p -> two -> size ;
19201920 diff_free_filespec_data (p -> two );
@@ -2668,8 +2668,9 @@ static int diff_populate_gitlink(struct diff_filespec *s, int size_only)
26682668 * grab the data for the blob (or file) for our own in-core comparison.
26692669 * diff_filespec has data and size fields for this purpose.
26702670 */
2671- int diff_populate_filespec (struct diff_filespec * s , int size_only )
2671+ int diff_populate_filespec (struct diff_filespec * s , unsigned int flags )
26722672{
2673+ int size_only = flags & CHECK_SIZE_ONLY ;
26732674 int err = 0 ;
26742675 /*
26752676 * demote FAIL to WARN to allow inspecting the situation
@@ -4688,8 +4689,8 @@ static int diff_filespec_check_stat_unmatch(struct diff_filepair *p)
46884689 !DIFF_FILE_VALID (p -> two ) ||
46894690 (p -> one -> sha1_valid && p -> two -> sha1_valid ) ||
46904691 (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 ) ||
46934694 (p -> one -> size != p -> two -> size ) ||
46944695 !diff_filespec_is_identical (p -> one , p -> two )) /* (2) */
46954696 p -> skip_stat_unmatch_result = 1 ;
0 commit comments