diff options
| author | Junio C Hamano <gitster@pobox.com> | 2007-11-09 21:13:46 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2007-11-09 21:13:46 -0800 |
| commit | 0d9d89f61c58f72d96585a61defb0634873c38ac (patch) | |
| tree | fcb314481bb669dcf1f33ba3934786c1dcc51b12 /builtin-diff.c | |
| parent | 14965530727e967806a5c62d7c826104baaec3c0 (diff) | |
| parent | c238dad407aec1ccf6e364f9c95e10e7f84eac8f (diff) | |
| download | git-0d9d89f61c58f72d96585a61defb0634873c38ac.tar.gz | |
Merge master into aw/mirror-push
Diffstat (limited to 'builtin-diff.c')
| -rw-r--r-- | builtin-diff.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/builtin-diff.c b/builtin-diff.c index f77352b40d..f557d21929 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -200,15 +200,11 @@ static void refresh_index_quietly(void) discard_cache(); read_cache(); refresh_cache(REFRESH_QUIET|REFRESH_UNMERGED); - if (active_cache_changed) { - if (write_cache(fd, active_cache, active_nr) || - close(fd) || - commit_locked_index(lock_file)) - ; /* - * silently ignore it -- we haven't mucked - * with the real index. - */ - } + + if (active_cache_changed && + !write_cache(fd, active_cache, active_nr) && !close(fd)) + commit_locked_index(lock_file); + rollback_lock_file(lock_file); } |
