diff options
Diffstat (limited to 'builtin-merge.c')
-rw-r--r-- | builtin-merge.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-merge.c b/builtin-merge.c index 6f1311414b..9f60ffa2cd 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -24,6 +24,7 @@ #include "rerere.h" #include "help.h" #include "merge-recursive.h" +#include "resolve-undo.h" #define DEFAULT_TWOHEAD (1<<0) #define DEFAULT_OCTOPUS (1<<1) @@ -606,6 +607,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common, discard_cache(); if (read_cache() < 0) die("failed to read the cache"); + resolve_undo_clear(); return ret; } } @@ -620,11 +622,10 @@ static void count_diff_files(struct diff_queue_struct *q, static int count_unmerged_entries(void) { - const struct index_state *state = &the_index; int i, ret = 0; - for (i = 0; i < state->cache_nr; i++) - if (ce_stage(state->cache[i])) + for (i = 0; i < active_nr; i++) + if (ce_stage(active_cache[i])) ret++; return ret; @@ -864,6 +865,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix) die("You have not concluded your merge (MERGE_HEAD exists)."); } + resolve_undo_clear(); /* * Check if we are _not_ on a detached HEAD, i.e. if there is a * current branch. |