From c4e3cca1f71d34e69bdbfa0de0144ddb00f75505 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 17 Apr 2005 09:53:35 -0700 Subject: [PATCH] [PATCH] update-cache --remove marks the path merged. When update-cache --remove is run, resolve unmerged state for the path. This is consistent with the update-cache --add behaviour. Essentially, the user is telling us how he wants to resolve the merge by running update-cache. Signed-off-by: Junio C Hamano Fixed to do the right thing at the end. Signed-off-by: Linus Torvalds --- read-cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 21f6e8e4d5..03d49e1026 100644 --- a/read-cache.c +++ b/read-cache.c @@ -369,7 +369,9 @@ static int remove_entry_at(int pos) int remove_file_from_cache(char *path) { int pos = cache_name_pos(path, strlen(path)); - if (pos >= 0) + if (pos < 0) + pos = -pos-1; + while (pos < active_nr && !strcmp(active_cache[pos]->name, path)) remove_entry_at(pos); return 0; } -- 2.11.4.GIT