summaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-04-03 12:33:05 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-04-03 12:33:05 -0700
commit44ec754dc766e38684d9ad4563019378730eea82 (patch)
treee8be72b52ab4827a58dc72518dbc5068313931f1 /builtin/diff.c
parentMerge branch 'lt/default-abbrev' into maint (diff)
parentupdate $GIT_INDEX_FILE when there are racily clean entries (diff)
downloadtgif-44ec754dc766e38684d9ad4563019378730eea82.tar.xz
Merge branch 'jc/index-update-if-able' into maint
* 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 42822cd537..d4d80c982e 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)