summaryrefslogtreecommitdiff
path: root/src/tree.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-05 09:11:17 +0200
committerVicent Marti <tanoku@gmail.com>2011-02-05 09:11:17 +0200
commit4569bfa55a44be3a03cf925df44bf1af0f21ddaa (patch)
treea3eb7ca3f6b2ebc201c2bb453b4d24d99f0d2221 /src/tree.h
parent5d773a6ee8542a5eaf94c34efcd27124c78e0bc7 (diff)
downloadlibgit2-4569bfa55a44be3a03cf925df44bf1af0f21ddaa.tar.gz
Keep the tree entries always internally sorted
Don't allow access to any tree entries whilst the entries array is unsorted. We keep track on when the array is unsorted, and any methods that access the array while it is unsorted now sort the array before accessing it. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/tree.h')
-rw-r--r--src/tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tree.h b/src/tree.h
index 78500c471..796c5b950 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -16,6 +16,7 @@ struct git_tree_entry {
struct git_tree {
git_object object;
git_vector entries;
+ unsigned sorted:1;
};
void git_tree__free(git_tree *tree);