From: Junio C Hamano Date: Sun, 27 Mar 2011 03:13:16 +0000 (-0700) Subject: Merge branch 'jc/index-update-if-able' X-Git-Tag: v1.7.5-rc0~18 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=149971badc562f4e5ee66c045f40c904fb29eab6;p=git.git 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 --- 149971badc562f4e5ee66c045f40c904fb29eab6 diff --cc builtin/commit.c index 3979b823e,0b6ce2fa3..54b20497b --- a/builtin/commit.c +++ b/builtin/commit.c @@@ -1203,15 -1090,11 +1203,10 @@@ int cmd_status(int argc, const char **a 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.in_merge = in_merge; s.ignore_submodule_arg = ignore_submodule_arg; wt_status_collect(&s);