From 75261421ec00b6dc0a72931ed7640743a4998c7d Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 4 Jul 2012 11:58:04 +0200 Subject: refs: add git_reference_has_log() --- include/git2/refs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/git2') diff --git a/include/git2/refs.h b/include/git2/refs.h index 2aa0ac267..7f6eb0e9b 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -353,6 +353,16 @@ GIT_EXTERN(int) git_reference_foreach_glob( void *payload ); +/** + * Check if a reflog exists for the specified reference. + * + * @param ref A git reference + * + * @return 0 when no reflog can be found, 1 when it exists; + * otherwise an error code. + */ +GIT_EXTERN(int) git_reference_has_log(git_reference *ref); + /** @} */ GIT_END_DECL #endif -- cgit v1.2.1 From 33c3370700083b9138b167778814d5af06ccf0b4 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 4 Jul 2012 12:20:43 +0200 Subject: refs: deploy git_reference_has_log() --- include/git2/reflog.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/git2') diff --git a/include/git2/reflog.h b/include/git2/reflog.h index f490e29de..8acba349b 100644 --- a/include/git2/reflog.h +++ b/include/git2/reflog.h @@ -53,6 +53,8 @@ GIT_EXTERN(int) git_reflog_write(git_reference *ref, const git_oid *oid_old, con /** * Rename the reflog for the given reference * + * The reflog to be renamed is expected to already exist + * * @param ref the reference * @param new_name the new name of the reference * @return 0 or an error code -- cgit v1.2.1