@@ -362,10 +362,12 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
362
362
int silent_on_removed = option & DIFF_SILENT_ON_REMOVED ;
363
363
unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED )
364
364
? CE_MATCH_RACY_IS_DIRTY : 0 );
365
+ char symcache [PATH_MAX ];
365
366
366
367
if (diff_unmerged_stage < 0 )
367
368
diff_unmerged_stage = 2 ;
368
369
entries = active_nr ;
370
+ symcache [0 ] = '\0' ;
369
371
for (i = 0 ; i < entries ; i ++ ) {
370
372
struct stat st ;
371
373
unsigned int oldmode , newmode ;
@@ -397,16 +399,17 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
397
399
memset (& (dpath -> parent [0 ]), 0 ,
398
400
sizeof (struct combine_diff_parent )* 5 );
399
401
400
- if (lstat (ce -> name , & st ) < 0 ) {
401
- if (errno != ENOENT && errno != ENOTDIR ) {
402
+ changed = check_work_tree_entity (ce , & st , symcache );
403
+ if (!changed )
404
+ dpath -> mode = ce_mode_from_stat (ce , st .st_mode );
405
+ else {
406
+ if (changed < 0 ) {
402
407
perror (ce -> name );
403
408
continue ;
404
409
}
405
410
if (silent_on_removed )
406
411
continue ;
407
412
}
408
- else
409
- dpath -> mode = ce_mode_from_stat (ce , st .st_mode );
410
413
411
414
while (i < entries ) {
412
415
struct cache_entry * nce = active_cache [i ];
@@ -459,8 +462,10 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
459
462
460
463
if (ce_uptodate (ce ))
461
464
continue ;
462
- if (lstat (ce -> name , & st ) < 0 ) {
463
- if (errno != ENOENT && errno != ENOTDIR ) {
465
+
466
+ changed = check_work_tree_entity (ce , & st , symcache );
467
+ if (changed ) {
468
+ if (changed < 0 ) {
464
469
perror (ce -> name );
465
470
continue ;
466
471
}
0 commit comments