diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-02-27 22:22:45 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-02-27 22:26:37 +0100 |
| commit | f7367993cba7b6a3c72da0b4a09c0ae88c7446c0 (patch) | |
| tree | 119fbaa24c00c42300d6c424c7c0094d9638e1ea /include/git2/revwalk.h | |
| parent | f0fa1c1a73f5a19a9799c0f8b90dcd533154cb3a (diff) | |
| download | libgit2-f7367993cba7b6a3c72da0b4a09c0ae88c7446c0.tar.gz | |
revwalk: add convenience function to push/hide HEAD
It's not unusual to want the walker to act on HEAD, so add a
convencience function for the case that the user doesn't already have
a resolved HEAD reference.
Diffstat (limited to 'include/git2/revwalk.h')
| -rw-r--r-- | include/git2/revwalk.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h index 020c898ca..e7ec2abf3 100644 --- a/include/git2/revwalk.h +++ b/include/git2/revwalk.h @@ -117,6 +117,14 @@ GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid); GIT_EXTERN(int) git_revwalk_push_glob(git_revwalk *walk, const char *glob); /** + * Push the repository's HEAD + * + * @param walk the walker being used for the traversal + * @return GIT_SUCCESS or an error code + */ +GIT_EXTERN(int) git_revwalk_push_head(git_revwalk *walk); + +/** * Mark a commit (and its ancestors) uninteresting for the output. * * The given OID must belong to a commit on the walked @@ -148,6 +156,14 @@ GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, const git_oid *oid); GIT_EXTERN(int) git_revwalk_hide_glob(git_revwalk *walk, const char *glob); /** + * Hide the repository's HEAD + * + * @param walk the walker being used for the traversal + * @return GIT_SUCCESS or an error code + */ +GIT_EXTERN(int) git_revwalk_hide_head(git_revwalk *walk); + +/** * Get the next commit from the revision walk. * * The initial call to this method is *not* blocking when |
