Merge branch 'ma/skip-writing-unchanged-index'
Internal API clean-up to allow write_locked_index() optionally skip writing the in-core index when it is not modified. * ma/skip-writing-unchanged-index: write_locked_index(): add flag to avoid writing unchanged index
This commit is contained in:
@ -2538,6 +2538,12 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
|
||||
int new_shared_index, ret;
|
||||
struct split_index *si = istate->split_index;
|
||||
|
||||
if ((flags & SKIP_IF_UNCHANGED) && !istate->cache_changed) {
|
||||
if (flags & COMMIT_LOCK)
|
||||
rollback_lock_file(lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (istate->fsmonitor_last_update)
|
||||
fill_fsmonitor_bitmap(istate);
|
||||
|
||||
|
Reference in New Issue
Block a user