Commit b85929c5 by Carlos Martín Nieto

tree: use the sorted update list in our loop

The loop is made with the assumption that the inputs are sorted and not
using it leads to bad outputs.
parent 1d41b86c
......@@ -1164,8 +1164,8 @@ int git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseli
goto cleanup;
for (i = 0; i < nupdates; i++) {
const git_tree_update *last_update = i == 0 ? NULL : &updates[i-1];
const git_tree_update *update = &updates[i];
const git_tree_update *last_update = i == 0 ? NULL : git_vector_get(&entries, i-1);
const git_tree_update *update = git_vector_get(&entries, i);
size_t common_prefix = 0, steps_up, j;
const char *path;
......
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