diff options
author | Vicent Martà <tanoku@gmail.com> | 2011-06-06 18:26:50 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2011-06-06 18:26:50 -0700 |
commit | 00c31dd293c43f071e7b4b5cbb3670a4bdb60916 (patch) | |
tree | a94c1254d2d6cbcafdc7eead24044598eb2c90dd /include/git2 | |
parent | 2c9e7fa35e915bc0cb71fe93f9424f3bc5f1b78a (diff) | |
parent | c5d8745fca5c6f098b76d00c9c1b169c1a66610f (diff) | |
download | libgit2-00c31dd293c43f071e7b4b5cbb3670a4bdb60916.tar.gz |
Merge pull request #234 from Romain-Geissler/entry-count-API-uniformisation
[Tree | Index] API uniformisation
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/index.h | 16 | ||||
-rw-r--r-- | include/git2/tree.h | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/include/git2/index.h b/include/git2/index.h index fa1cadeab..83a18e160 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -257,7 +257,7 @@ GIT_EXTERN(int) git_index_remove(git_index *index, int position); * @param n the position of the entry * @return a pointer to the entry; NULL if out of bounds */ -GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, int n); +GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, unsigned int n); /** * Get the count of entries currently in the index @@ -285,7 +285,19 @@ GIT_EXTERN(unsigned int) git_index_entrycount_unmerged(git_index *index); * @param path path to search * @return the unmerged entry; NULL if not found */ -GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged(git_index *index, const char *path); +GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_bypath(git_index *index, const char *path); + +/** + * Get an unmerged entry from the index. + * + * The returned entry is read-only and should not be modified + * of freed by the caller. + * + * @param index an existing index object + * @param n the position of the entry + * @return a pointer to the unmerged entry; NULL if out of bounds + */ +GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_byindex(git_index *index, unsigned int n); /** * Return the stage number from a git index entry diff --git a/include/git2/tree.h b/include/git2/tree.h index 0caf60a48..2a4522b3c 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -84,7 +84,7 @@ GIT_EXTERN(const git_oid *) git_tree_id(git_tree *tree); * @param tree a previously loaded tree. * @return the number of entries in the tree */ -GIT_EXTERN(size_t) git_tree_entrycount(git_tree *tree); +GIT_EXTERN(unsigned int) git_tree_entrycount(git_tree *tree); /** * Lookup a tree entry by its filename @@ -102,7 +102,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(git_tree *tree, const c * @param idx the position in the entry list * @return the tree entry; NULL if not found */ -GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, int idx); +GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, unsigned int idx); /** * Get the UNIX file attributes of a tree entry |