@@ -272,20 +272,26 @@ static int ce_match_stat_basic(const struct cache_entry *ce, struct stat *st)
272
272
return changed ;
273
273
}
274
274
275
- static int is_racy_timestamp (const struct index_state * istate ,
276
- const struct cache_entry * ce )
275
+ static int is_racy_stat (const struct index_state * istate ,
276
+ const struct stat_data * sd )
277
277
{
278
- return (!S_ISGITLINK (ce -> ce_mode ) &&
279
- istate -> timestamp .sec &&
278
+ return (istate -> timestamp .sec &&
280
279
#ifdef USE_NSEC
281
280
/* nanosecond timestamped files can also be racy! */
282
- (istate -> timestamp .sec < ce -> ce_stat_data . sd_mtime .sec ||
283
- (istate -> timestamp .sec == ce -> ce_stat_data . sd_mtime .sec &&
284
- istate -> timestamp .nsec <= ce -> ce_stat_data . sd_mtime .nsec ))
281
+ (istate -> timestamp .sec < sd -> sd_mtime .sec ||
282
+ (istate -> timestamp .sec == sd -> sd_mtime .sec &&
283
+ istate -> timestamp .nsec <= sd -> sd_mtime .nsec ))
285
284
#else
286
- istate -> timestamp .sec <= ce -> ce_stat_data . sd_mtime .sec
285
+ istate -> timestamp .sec <= sd -> sd_mtime .sec
287
286
#endif
288
- );
287
+ );
288
+ }
289
+
290
+ static int is_racy_timestamp (const struct index_state * istate ,
291
+ const struct cache_entry * ce )
292
+ {
293
+ return (!S_ISGITLINK (ce -> ce_mode ) &&
294
+ is_racy_stat (istate , & ce -> ce_stat_data ));
289
295
}
290
296
291
297
int ie_match_stat (const struct index_state * istate ,
0 commit comments