Re: [PATCH v3] Enable minimal stat checking
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Jan 22, 2013, 17:19 UTC
- Message-ID
- <50FECA14.5030802@web.de>
- In-Reply-To
- <1358840962-12316-1-git-send-email-robin.rosenberg@dewire.com>
+core.checkstat:: + Determines which stat fields to match between the index + and work tree. The user can set this to 'default' or + 'minimal'. Default (or explicitly 'default'), is to check + all fields, including the sub-second part of mtime and ctime. + Setting 'minimal' implies core.trustctime = false
[snip]
Show 5 quoted lines
> - if (trust_ctime && ce->ce_ctime.sec != (unsigned int)st->st_ctime) > - changed |= CTIME_CHANGED; > + if (trust_ctime ? check_stat : trust_ctime/*false*/) > + if (ce->ce_ctime.sec != (unsigned int)st->st_ctime) > + changed |= CTIME_CHANGED;
Could that be written as: + if (trust_ctime && check_stat && (ce->ce_ctime.sec != (unsigned int)st->st_ctime)) + changed |= CTIME_CHANGED;
Show 10 quoted lines
> > #ifdef USE_NSEC > - if (ce->ce_mtime.nsec != ST_MTIME_NSEC(*st)) > + if (check_stat && ce->ce_mtime.nsec != ST_MTIME_NSEC(*st)) > changed |= MTIME_CHANGED; > - if (trust_ctime && ce->ce_ctime.nsec != ST_CTIME_NSEC(*st)) > - changed |= CTIME_CHANGED; > + if (trust_ctime ? check_stat : trust_ctime/*false*/) > + if (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st)) > + changed |= CTIME_CHANGED;
And here: + if (trust_ctime && check_stat && (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st)) + changed |= CTIME_CHANGED;