Message ID | 6152122c04aacf8c3e3f1aae7b73995da6b9e354.1605051739.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix color handling in git add -i | expand |
diff --git a/add-interactive.c b/add-interactive.c index 555c4abf32..8ca503d803 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -194,7 +194,8 @@ static ssize_t find_unique(const char *string, struct prefix_item_list *list) else if (index + 1 < list->sorted.nr && starts_with(list->sorted.items[index + 1].string, string)) return -1; - else if (index < list->sorted.nr) + else if (index < list->sorted.nr && + starts_with(list->sorted.items[index].string, string)) item = list->sorted.items[index].util; else return -1;