From 5bdedac3c7b0894643256304cd5f0dd29cf8eec9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 31 Jul 2023 15:44:09 -0700 Subject: checkout: allow "checkout -m path" to unmerge removed paths "git checkout -m -- path" uses the unmerge_marked_index() API, whose implementation is incapable of unresolving a path that was resolved as removed. Extend the unmerge_index() API function so that we can mark the ce_flags member of the cache entries we add to the index as unmerged, and replace use of unmerge_marked_index() with it. Now, together with its unmerge_index_entry_at() helper function, unmerge_marked_index() function is no longer called by anybody, and can safely be removed. This makes two known test failures in t2070 and t7201 to succeed. Signed-off-by: Junio C Hamano --- rerere.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rerere.c') diff --git a/rerere.c b/rerere.c index e968d413d6..b525dd9230 100644 --- a/rerere.c +++ b/rerere.c @@ -1112,7 +1112,7 @@ int rerere_forget(struct repository *r, struct pathspec *pathspec) * recover the original conflicted state and then * find the conflicted paths. */ - unmerge_index(r->index, pathspec); + unmerge_index(r->index, pathspec, 0); find_conflict(r, &conflict); for (i = 0; i < conflict.nr; i++) { struct string_list_item *it = &conflict.items[i]; -- cgit v1.2.3