@@ -272,20 +272,26 @@ static int ce_match_stat_basic(const struct cache_entry *ce, struct stat *st)
272272 return changed ;
273273}
274274
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 )
277277{
278- return (!S_ISGITLINK (ce -> ce_mode ) &&
279- istate -> timestamp .sec &&
278+ return (istate -> timestamp .sec &&
280279#ifdef USE_NSEC
281280 /* 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 ))
285284#else
286- istate -> timestamp .sec <= ce -> ce_stat_data . sd_mtime .sec
285+ istate -> timestamp .sec <= sd -> sd_mtime .sec
287286#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 ));
289295}
290296
291297int ie_match_stat (const struct index_state * istate ,
0 commit comments