diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-20 11:12:34 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-02 06:53:24 +0200 |
commit | d274deea23a2c2a70ee1695e8f917dbca50c76b7 (patch) | |
tree | f3ddf7a3476ad6ae465d2657a2bbfc3ae6268e7d /include/git2/reflog.h | |
parent | b976f3c2c228413d124be8fea3280a44bd5e3136 (diff) | |
download | libgit2-d274deea23a2c2a70ee1695e8f917dbca50c76b7.tar.gz |
reflog: add a convenience append function
Provide a function that reads a reflog, performs an append and writes back to the
backend in one call.
Diffstat (limited to 'include/git2/reflog.h')
-rw-r--r-- | include/git2/reflog.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/git2/reflog.h b/include/git2/reflog.h index b31472c37..2d1b6eeaa 100644 --- a/include/git2/reflog.h +++ b/include/git2/reflog.h @@ -60,6 +60,23 @@ GIT_EXTERN(int) git_reflog_write(git_reflog *reflog); GIT_EXTERN(int) git_reflog_append(git_reflog *reflog, const git_oid *id, const git_signature *committer, const char *msg); /** + * Add a new entry to the named reflog. + * + * This utility function loads the named reflog, appends to it and + * writes it back out to the backend. + * + * `msg` is optional and can be NULL. + * + * @param repo the repository to act on + * @param name the reflog's name + * @param id the OID the reference is now pointing to + * @param committer the signature of the committer + * @param msg the reflog message + * @return 0 or an error code + */ +GIT_EXTERN(int) git_reflog_append_to(git_repository *repo, const char *name, const git_oid *id, const git_signature *committer, const char *msg); + +/** * Rename a reflog * * The reflog to be renamed is expected to already exist |