diff options
Diffstat (limited to 'src/git2')
| -rw-r--r-- | src/git2/common.h | 3 | ||||
| -rw-r--r-- | src/git2/repository.h | 9 | ||||
| -rw-r--r-- | src/git2/revwalk.h | 7 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/git2/common.h b/src/git2/common.h index aae707cb6..3500a2b14 100644 --- a/src/git2/common.h +++ b/src/git2/common.h @@ -151,6 +151,9 @@ /** The path is invalid */ #define GIT_EINVALIDPATH (GIT_ERROR - 19) +/** The revision walker is empty; there are no more commits left to iterate */ +#define GIT_EREVWALKOVER (GIT_ERROR - 20) + GIT_BEGIN_DECL /** @} */ GIT_END_DECL diff --git a/src/git2/repository.h b/src/git2/repository.h index ecf3db99f..ec74305ae 100644 --- a/src/git2/repository.h +++ b/src/git2/repository.h @@ -163,11 +163,14 @@ GIT_EXTERN(git_odb *) git_repository_database(git_repository *repo); /** * Get the Index file of a Git repository * + * This is a cheap operation; the index is only opened on the first call, + * and subsequent calls only retrieve the previous pointer. + * + * @param index Pointer where to store the index * @param repo a repository object - * @return a pointer to the Index object; - * NULL if the index cannot be opened + * @return 0 on success; error code if the index could not be opened */ -GIT_EXTERN(git_index *) git_repository_index(git_repository *rpeo); +GIT_EXTERN(int) git_repository_index(git_index **index, git_repository *repo); /** * Create a new in-memory repository object with diff --git a/src/git2/revwalk.h b/src/git2/revwalk.h index 960039a39..841110499 100644 --- a/src/git2/revwalk.h +++ b/src/git2/revwalk.h @@ -99,10 +99,13 @@ GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, git_commit *commit); /** * Get the next commit from the revision traversal. + * + * @param commit Pointer where to store the next commit * @param walk the walker to pop the commit from. - * @return next commit; NULL if there is no more output. + * @return GIT_SUCCESS if the next commit was found; + * GIT_EREVWALKOVER if there are no commits left to iterate */ -GIT_EXTERN(git_commit *) git_revwalk_next(git_revwalk *walk); +GIT_EXTERN(int) git_revwalk_next(git_commit **commit, git_revwalk *walk); /** * Change the sorting mode when iterating through the |
