diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2016-03-20 11:00:12 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2016-03-20 11:00:12 +0100 |
commit | 60a194aa86d54ffb55c1abff8d0ef05647f936e8 (patch) | |
tree | f8312c890d8a5862d1d3ee705fe97fc0778f1bb2 /src/iterator.c | |
parent | ec5a43b60ab0dfcb42db8101edfca34be3d62947 (diff) | |
download | libgit2-60a194aa86d54ffb55c1abff8d0ef05647f936e8.tar.gz |
tree: re-use the id and filename in the odb object
Instead of copying over the data into the individual entries, point to
the originals, which are already in a format we can use.
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/iterator.c b/src/iterator.c index 024a97573..cb1ea6a87 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -458,7 +458,7 @@ static int tree_iterator__set_next(tree_iterator *ti, tree_iterator_frame *tf) /* try to load trees for items in [current,next) range */ if (!error && git_tree_entry__is_tree(te)) error = git_tree_lookup( - &tf->entries[tf->next]->tree, ti->base.repo, &te->oid); + &tf->entries[tf->next]->tree, ti->base.repo, te->oid); } if (tf->next > tf->current + 1) @@ -603,7 +603,7 @@ static int tree_iterator__update_entry(tree_iterator *ti) te = tf->entries[tf->current]->te; ti->entry.mode = te->attr; - git_oid_cpy(&ti->entry.id, &te->oid); + git_oid_cpy(&ti->entry.id, te->oid); ti->entry.path = tree_iterator__current_filename(ti, te); GITERR_CHECK_ALLOC(ti->entry.path); |