diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2016-11-14 12:44:01 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2016-11-14 12:44:01 +0100 |
| commit | b85929c523d7e61ba76715199831ec05089dc844 (patch) | |
| tree | 1085f0d39e0d970053c1c4510a8665a63bc4b129 /src/tree.c | |
| parent | 1d41b86cd00eda52155ddddfed65dfcc41aa906a (diff) | |
| download | libgit2-b85929c523d7e61ba76715199831ec05089dc844.tar.gz | |
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.
Diffstat (limited to 'src/tree.c')
| -rw-r--r-- | src/tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tree.c b/src/tree.c index e338acca0..b67b16249 100644 --- a/src/tree.c +++ b/src/tree.c @@ -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; |
