diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-20 14:44:31 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-20 14:46:35 -0800 |
commit | 6751e0471df1bdc4a1d5e5a3929a531c74e95aeb (patch) | |
tree | 4f25445b5ceb6f83473f60a36c7d09d2e1f0378e /builtin-merge.c | |
parent | 030b1a77f72a7e3307c7d7881ae570ca1c8ed877 (diff) | |
parent | dea4562bf5d1c27cd6c01b9cb65c3a8b8ee99a69 (diff) | |
download | git-6751e0471df1bdc4a1d5e5a3929a531c74e95aeb.tar.gz |
Merge branch 'jc/cache-unmerge'
* jc/cache-unmerge:
rerere forget path: forget recorded resolution
rerere: refactor rerere logic to make it independent from I/O
rerere: remove silly 1024-byte line limit
resolve-undo: teach "update-index --unresolve" to use resolve-undo info
resolve-undo: "checkout -m path" uses resolve-undo information
resolve-undo: allow plumbing to clear the information
resolve-undo: basic tests
resolve-undo: record resolved conflicts in a new index extension section
builtin-merge.c: use standard active_cache macros
Conflicts:
builtin-ls-files.c
builtin-merge.c
builtin-rerere.c
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. |