summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-17 16:53:35 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 16:53:35 (GMT)
commitc4e3cca1f71d34e69bdbfa0de0144ddb00f75505 (patch)
treeea208e8b6d59f8a367af2886a381cb000d42713b /read-cache.c
parent8f41523fc1a8cd127ff39fa111b3b5bb5105cc84 (diff)
downloadgit-c4e3cca1f71d34e69bdbfa0de0144ddb00f75505.zip
git-c4e3cca1f71d34e69bdbfa0de0144ddb00f75505.tar.gz
git-c4e3cca1f71d34e69bdbfa0de0144ddb00f75505.tar.bz2
[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 <junkio@cox.net> Fixed to do the right thing at the end. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 21f6e8e..03d49e1 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;
}