Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-12 01:45:35 +0300
committerJunio C Hamano <junkio@cox.net>2006-11-12 01:46:11 +0300
commit057bc808b4aa2e7795f9bd395e68071301bc0b74 (patch)
tree33cd56f56479672463071ab8789faca61583cd57
parenta6ec3c1599f990b4f2f3dab2606688639f74d844 (diff)
path-list: fix path-list-insert return value
When path-list-insert is called on an existing path, it returned an unrelated element in the list. Luckily most of the callers are ignoring the return value, but merge-recursive uses it at three places and this would have resulted in a bogus rename detection. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--path-list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/path-list.c b/path-list.c
index 0c332dc7b5..f8800f8e66 100644
--- a/path-list.c
+++ b/path-list.c
@@ -57,7 +57,7 @@ struct path_list_item *path_list_insert(const char *path, struct path_list *list
int index = add_entry(list, path);
if (index < 0)
- index = 1 - index;
+ index = -1 - index;
return list->items + index;
}