From f7367993cba7b6a3c72da0b4a09c0ae88c7446c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 27 Feb 2012 22:22:45 +0100 Subject: 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. --- include/git2/revwalk.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/git2') diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h index 020c898c..e7ec2abf 100644 --- a/include/git2/revwalk.h +++ b/include/git2/revwalk.h @@ -116,6 +116,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. * @@ -147,6 +155,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. * -- cgit v1.2.1