Merge branch 'jc/index-update-if-able'

* jc/index-update-if-able:
  update $GIT_INDEX_FILE when there are racily clean entries
  diff/status: refactor opportunistic index update
This commit is contained in:
Junio C Hamano
2011-03-26 20:13:16 -07:00
4 changed files with 29 additions and 13 deletions

View File

@ -1203,13 +1203,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, s.pathspec, NULL, NULL);
fd = hold_locked_index(&index_lock, 0);
if (0 <= fd) {
if (active_cache_changed &&
!write_cache(fd, active_cache, active_nr))
commit_locked_index(&index_lock);
else
rollback_lock_file(&index_lock);
}
if (0 <= fd)
update_index_if_able(&the_index, &index_lock);
s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;
s.ignore_submodule_arg = ignore_submodule_arg;