Skip to content

Commit

Permalink
merge-recur: do not die unnecessarily
Browse files Browse the repository at this point in the history
When the cache is dirty, and we switch the index file from temporary
to final, we want to discard the cache without complaint.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Aug 9, 2006
1 parent 8918b0c commit 984b657
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ static int flush_cache(void)
static void setup_index(int temp)
{
current_index_file = temp ? temporary_index_file: original_index_file;
if (cache_dirty)
die("fatal: cache changed flush_cache();");
if (cache_dirty) {
discard_cache();
cache_dirty = 0;
}
unlink(temporary_index_file);
discard_cache();
}
Expand Down

0 comments on commit 984b657

Please sign in to comment.