merge-recur: do not die unnecessarily
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>
Johannes Schindelin committed
Aug 9, 2006 at 22:31 UTC
984b65707e25c426a32feb9b9d46f077b605cb31
1 file changed
+4
-2
merge-recursive.c
+4
-2
@@ -139,8 +139,10 @@ static int flush_cache(void)
139
static void setup_index(int temp)
140
{
141
current_index_file = temp ? temporary_index_file: original_index_file;
142
- if (cache_dirty)
143
- die("fatal: cache changed flush_cache();");
142
+ if (cache_dirty) {
143
+ discard_cache();
144
+ cache_dirty = 0;
145
+ }
146
unlink(temporary_index_file);
147
discard_cache();
148
}