diff options
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/branch.h | 18 | ||||
-rw-r--r-- | include/git2/clone.h | 7 | ||||
-rw-r--r-- | include/git2/refs.h | 6 | ||||
-rw-r--r-- | include/git2/repository.h | 12 |
4 files changed, 37 insertions, 6 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h index 851de290a..46aef3206 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -43,6 +43,12 @@ GIT_BEGIN_DECL * * @param force Overwrite existing branch. * + * @param signature The identity that will used to populate the reflog entry + * + * @param log_message The one line long message to be appended to the reflog. + * If NULL, the default is "Branch: created"; if you want something more + * useful, provide a message. + * * @return 0, GIT_EINVALIDSPEC or an error code. * A proper reference is written in the refs/heads namespace * pointing to the provided target commit. @@ -52,7 +58,9 @@ GIT_EXTERN(int) git_branch_create( git_repository *repo, const char *branch_name, const git_commit *target, - int force); + int force, + const git_signature *signature, + const char *log_message); /** * Delete an existing branch reference. @@ -115,13 +123,19 @@ GIT_EXTERN(void) git_branch_iterator_free(git_branch_iterator *iter); * * @param force Overwrite existing branch. * + * @param signature The identity that will used to populate the reflog entry + * + * @param log_message The one line long message to be appended to the reflog + * * @return 0 on success, GIT_EINVALIDSPEC or an error code. */ GIT_EXTERN(int) git_branch_move( git_reference **out, git_reference *branch, const char *new_branch_name, - int force); + int force, + const git_signature *signature, + const char *log_message); /** * Lookup a branch by its name in a repository. diff --git a/include/git2/clone.h b/include/git2/clone.h index 59a73aa15..3e885d103 100644 --- a/include/git2/clone.h +++ b/include/git2/clone.h @@ -45,6 +45,8 @@ GIT_BEGIN_DECL * default is "origin". * - `checkout_branch` gives the name of the branch to checkout. NULL * means use the remote's HEAD. + * - `signature` is the identity used when updating the reflog. NULL means to + * use the default signature using the config. */ typedef struct git_clone_options { @@ -57,6 +59,7 @@ typedef struct git_clone_options { int ignore_cert_errors; const char *remote_name; const char* checkout_branch; + git_signature *signature; } git_clone_options; #define GIT_CLONE_OPTIONS_VERSION 1 @@ -96,6 +99,7 @@ GIT_EXTERN(int) git_clone( * @param co_opts options to use during checkout * @param branch the branch to checkout after the clone, pass NULL for the * remote's default branch + * @param signature The identity used when updating the reflog. * @return 0 on success, any non-zero return value from a callback * function, or a negative value to indicate an error (use * `giterr_last` for a detailed error message) @@ -104,7 +108,8 @@ GIT_EXTERN(int) git_clone_into( git_repository *repo, git_remote *remote, const git_checkout_opts *co_opts, - const char *branch); + const char *branch, + const git_signature *signature); /** @} */ GIT_END_DECL diff --git a/include/git2/refs.h b/include/git2/refs.h index b203f242b..976b7496b 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -297,6 +297,8 @@ GIT_EXTERN(int) git_reference_set_target( * @param ref The reference to rename * @param new_name The new name for the reference * @param force Overwrite an existing reference + * @param signature The identity that will used to populate the reflog entry + * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code * */ @@ -304,7 +306,9 @@ GIT_EXTERN(int) git_reference_rename( git_reference **new_ref, git_reference *ref, const char *new_name, - int force); + int force, + const git_signature *signature, + const char *log_message); /** * Delete an existing reference. diff --git a/include/git2/repository.h b/include/git2/repository.h index a0453da5c..648667cd6 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -567,11 +567,15 @@ GIT_EXTERN(int) git_repository_hashfile( * * @param repo Repository pointer * @param refname Canonical name of the reference the HEAD should point at + * @param signature The identity that will used to populate the reflog entry + * @param log_message The one line long message to be appended to the reflog * @return 0 on success, or an error code */ GIT_EXTERN(int) git_repository_set_head( git_repository* repo, - const char* refname); + const char* refname, + const git_signature *signature, + const char *log_message); /** * Make the repository HEAD directly point to the Commit. @@ -587,11 +591,15 @@ GIT_EXTERN(int) git_repository_set_head( * * @param repo Repository pointer * @param commitish Object id of the Commit the HEAD should point to + * @param signature The identity that will used to populate the reflog entry + * @param log_message The one line long message to be appended to the reflog * @return 0 on success, or an error code */ GIT_EXTERN(int) git_repository_set_head_detached( git_repository* repo, - const git_oid* commitish); + const git_oid* commitish, + const git_signature *signature, + const char *log_message); /** * Detach the HEAD. |