diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-05-14 16:07:33 +0200 |
---|---|---|
committer | Carlos MartÃn Nieto <cmn@dwim.me> | 2013-11-23 13:35:51 +0100 |
commit | 14ab0e100e9474c5d1fda37fb0f4eec9ee0e9d13 (patch) | |
tree | a5a0a27bab657b9a87560f68e41a0b082e230786 /include/git2/refs.h | |
parent | 56ad3782e08cd1b2d26eee4014e77fac7a6c2414 (diff) | |
download | libgit2-14ab0e100e9474c5d1fda37fb0f4eec9ee0e9d13.tar.gz |
refs: Introduce git_reference_set_target_with_log()
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r-- | include/git2/refs.h | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ -335,6 +335,29 @@ GIT_EXTERN(int) git_reference_set_target( 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. * * This method works for both direct and symbolic references. |