diff options
author | Russell Belfer <rb@github.com> | 2012-11-21 11:03:07 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-27 13:18:29 -0800 |
commit | 16248ee2d1d67bd386277bca67f04049afef875e (patch) | |
tree | 2ae7078fbe8aa91dd0d094afc0a38c33a4cb6732 /include/git2/tree.h | |
parent | f45d51ff8e04c6849413c13aedcf5abacc3c69bd (diff) | |
download | libgit2-16248ee2d1d67bd386277bca67f04049afef875e.tar.gz |
Fix up some missing consts in tree & index
This fixes some missed places where we can apply const-ness to
various public APIs.
There are still some index and tree APIs that cannot take const
pointers because we sort our `git_vectors` lazily and so we can't
reliably bsearch the index and tree content without applying a
`git_vector_sort()` first.
This also fixes some missed places where size_t can be used and
where const can be applied to a couple internal functions.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r-- | include/git2/tree.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h index 0104ba144..2d3534fab 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -127,7 +127,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex( * @return the tree entry; NULL if not found */ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid( - git_tree *tree, const git_oid *oid); + const git_tree *tree, const git_oid *oid); /** * Retrieve a tree entry contained in a tree or in any of its subtrees, @@ -351,18 +351,15 @@ typedef enum { } git_treewalk_mode; /** - * Traverse the entries in a tree and its subtrees in - * post or pre order + * Traverse the entries in a tree and its subtrees in post or pre order. * - * The entries will be traversed in the specified order, - * children subtrees will be automatically loaded as required, - * and the `callback` will be called once per entry with - * the current (relative) root for the entry and the entry - * data itself. + * The entries will be traversed in the specified order, children subtrees + * will be automatically loaded as required, and the `callback` will be + * called once per entry with the current (relative) root for the entry and + * the entry data itself. * * If the callback returns a positive value, the passed entry will be - * skipped on the traversal (in pre mode). A negative value stops the - * walk. + * skipped on the traversal (in pre mode). A negative value stops the walk. * * @param tree The tree to walk * @param mode Traversal mode (pre or post-order) |