From: Junio C Hamano Date: Sat, 11 Nov 2006 22:45:35 +0000 (-0800) Subject: path-list: fix path-list-insert return value X-Git-Tag: v1.4.3.5~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=057bc808b4aa2e7795f9bd395e68071301bc0b74;p=git.git 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 --- diff --git a/path-list.c b/path-list.c index 0c332dc7b..f8800f8e6 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; }