Commit 181bbf14 by Vicent Martí

tree: Fix homing entry search

parent d3dd775e
......@@ -97,7 +97,7 @@ static int tree_key_search(git_vector *entries, const char *filename)
for (i = homing; i < (int)entries->length; ++i) {
entry = entries->contents[i];
if (homing_search_cmp(&ksearch, entry) != 0)
if (homing_search_cmp(&ksearch, entry) < 0)
break;
if (strcmp(filename, entry->filename) == 0)
......@@ -109,7 +109,7 @@ static int tree_key_search(git_vector *entries, const char *filename)
for (i = homing - 1; i >= 0; --i) {
entry = entries->contents[i];
if (homing_search_cmp(&ksearch, entry) != 0)
if (homing_search_cmp(&ksearch, entry) > 0)
break;
if (strcmp(filename, entry->filename) == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment