From: Junio C Hamano Date: Sun, 17 Apr 2005 16:53:35 +0000 (-0700) Subject: [PATCH] update-cache --remove marks the path merged. X-Git-Tag: v0.99~854 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c4e3cca1f71d34e69bdbfa0de0144ddb00f75505;p=git.git [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 --- diff --git a/read-cache.c b/read-cache.c index 21f6e8e4d..03d49e102 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; }