From 14ab0e100e9474c5d1fda37fb0f4eec9ee0e9d13 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Tue, 14 May 2013 16:07:33 +0200 Subject: refs: Introduce git_reference_set_target_with_log() --- include/git2/refs.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include/git2') diff --git a/include/git2/refs.h b/include/git2/refs.h index e47077354..172fdd284 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -334,6 +334,29 @@ GIT_EXTERN(int) git_reference_set_target( git_reference *ref, const git_oid *id); +/** + * Create a new reference with the same name as the given reference but a + * different OID target and update the reflog with a given message. + * + * The reference must be a direct reference, otherwise this will fail. + * + * The new reference will be written to disk, overwriting the given reference. + * + * @param out Pointer to the newly created reference + * @param ref The reference + * @param id The new target OID for the reference + * @param signature The identity that will used to populate the reflog entry + * @param log_message The one line long message that has to be appended + * to the reflog + * @return 0 or an error code + */ +GIT_EXTERN(int) git_reference_set_target_with_log( + git_reference **out, + git_reference *ref, + const git_oid *id, + const git_signature *signature, + const char *log_message); + /** * Rename an existing reference. * -- cgit v1.2.1