diff options
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/checkout.c | 6 | ||||
| -rw-r--r-- | builtin/update-index.c | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index b8dfba57c6..98fcf1220a 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -566,6 +566,8 @@ static int checkout_paths(const struct checkout_opts *opts, if (opts->source_tree) read_tree_some(opts->source_tree, &opts->pathspec); + if (opts->merge) + unmerge_index(&the_index, &opts->pathspec, CE_MATCHED); ps_matched = xcalloc(opts->pathspec.nr, 1); @@ -589,10 +591,6 @@ static int checkout_paths(const struct checkout_opts *opts, } free(ps_matched); - /* "checkout -m path" to recreate conflicted state */ - if (opts->merge) - unmerge_marked_index(&the_index); - /* Any unmerged paths? */ for (pos = 0; pos < the_index.cache_nr; pos++) { const struct cache_entry *ce = the_index.cache[pos]; diff --git a/builtin/update-index.c b/builtin/update-index.c index def7f98504..69fe9c8fcb 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -646,7 +646,7 @@ static int unresolve_one(const char *path) item = string_list_lookup(the_index.resolve_undo, path); if (!item) return res; /* no resolve-undo record for the path */ - res = unmerge_index_entry(&the_index, path, item->util); + res = unmerge_index_entry(&the_index, path, item->util, 0); FREE_AND_NULL(item->util); return res; } |
