summaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-26 20:13:16 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-26 20:13:16 -0700
commit149971badc562f4e5ee66c045f40c904fb29eab6 (patch)
tree020dbffb91e75d4a001bffe52c804018ca2f1e66 /builtin/diff.c
parent4d46ee74e11416e7edf6624611242fe2f98f078c (diff)
parent483fbe2b7cb89ddcf700a677735d21aa176bc5a6 (diff)
downloadgit-149971badc562f4e5ee66c045f40c904fb29eab6.tar.gz
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
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index 4c9deb28ec..655a013ed0 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -197,12 +197,7 @@ static void refresh_index_quietly(void)
discard_cache();
read_cache();
refresh_cache(REFRESH_QUIET|REFRESH_UNMERGED);
-
- if (active_cache_changed &&
- !write_cache(fd, active_cache, active_nr))
- commit_locked_index(lock_file);
-
- rollback_lock_file(lock_file);
+ update_index_if_able(&the_index, lock_file);
}
static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv)