diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2016-05-27 18:17:20 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2016-05-27 18:17:20 +0200 |
commit | b86ef47d2a7f67d44e56e102a54d8f2f2fe19d0c (patch) | |
tree | c3d34e7b1c0632cc6005782e332ffaeae2ab5fe8 | |
parent | 3978ab2ce86e75e02340a02842e8338a84341181 (diff) | |
download | libgit2-cmn/tree-parser-sort-input.tar.gz |
-rw-r--r-- | src/tree.c | 4 | ||||
-rw-r--r-- | tests/object/tree/update.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tree.c b/src/tree.c index 43eefa50e..714f9c72e 100644 --- a/src/tree.c +++ b/src/tree.c @@ -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; diff --git a/tests/object/tree/update.c b/tests/object/tree/update.c index b38646a5a..0e1398267 100644 --- a/tests/object/tree/update.c +++ b/tests/object/tree/update.c @@ -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); } |