summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-12-08 13:12:27 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-12-08 13:12:27 -0500
commitd698929cdd17b80e5c55a4f98c848f980c630cb1 (patch)
treedc95021859a43c65bd307d88dca652a930aae63f /src
parenta3dc4190e77ff794109c3ff2fbcb3fa87e5f7c48 (diff)
parentfc4364696556678f4cac4f6cefed17b94b4ec776 (diff)
downloadlibgit2-d698929cdd17b80e5c55a4f98c848f980c630cb1.tar.gz
Merge pull request #3537 from libgit2/cmn/tree-is-sorted
tree: mark a tree as already sorted
Diffstat (limited to 'src')
-rw-r--r--src/tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tree.c b/src/tree.c
index 2de8e72e1..aab4b58ad 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -476,7 +476,8 @@ int git_tree__parse(void *_tree, git_odb_object *odb_obj)
buffer += GIT_OID_RAWSZ;
}
- git_vector_sort(&tree->entries);
+ /* The tree is sorted by definition. Bad inputs give bad outputs */
+ tree->entries.flags |= GIT_VECTOR_SORTED;
return 0;
}