This commit is contained in:
Carlos Martín Nieto
2016-05-27 18:17:20 +02:00
parent 3978ab2ce8
commit b86ef47d2a
2 changed files with 3 additions and 3 deletions

View File

@@ -1159,8 +1159,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;

View File

@@ -190,7 +190,7 @@ void test_object_tree_update__add_blobs(void)
git_index_free(idx);
/* Perform the same operations via the tree updater */
cl_git_pass(git_tree_create_updated(&tree_updater_id, g_repo, base_tree, 3, updates));
cl_git_pass(git_tree_create_updated(&tree_updater_id, g_repo, base_tree, 4, updates));
cl_assert_equal_oid(&tree_index_id, &tree_updater_id);
}