summaryrefslogtreecommitdiff
path: root/include/git2/branch.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/branch.h')
-rw-r--r--include/git2/branch.h48
1 files changed, 25 insertions, 23 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h
index d372c2c92..4d24e2d82 100644
--- a/include/git2/branch.h
+++ b/include/git2/branch.h
@@ -50,11 +50,11 @@ GIT_BEGIN_DECL
* pointing to the provided target commit.
*/
GIT_EXTERN(int) git_branch_create(
- git_reference **out,
- git_repository *repo,
- const char *branch_name,
- const git_commit *target,
- int force);
+ git_reference **out,
+ git_repository *repo,
+ const char *branch_name,
+ const git_commit *target,
+ int force);
/**
* Delete an existing branch reference.
@@ -67,6 +67,11 @@ GIT_EXTERN(int) git_branch_create(
*/
GIT_EXTERN(int) git_branch_delete(git_reference *branch);
+typedef int (*git_branch_foreach_cb)(
+ const char *branch_name,
+ git_branch_t branch_type,
+ void *payload);
+
/**
* Loop over all the branches and issue a callback for each one.
*
@@ -85,14 +90,10 @@ GIT_EXTERN(int) git_branch_delete(git_reference *branch);
* @return 0 on success, GIT_EUSER on non-zero callback, or error code
*/
GIT_EXTERN(int) git_branch_foreach(
- git_repository *repo,
- unsigned int list_flags,
- int (*branch_cb)(
- const char *branch_name,
- git_branch_t branch_type,
- void *payload),
- void *payload
-);
+ git_repository *repo,
+ unsigned int list_flags,
+ git_branch_foreach_cb branch_cb,
+ void *payload);
/**
* Move/rename an existing local branch reference.
@@ -110,9 +111,10 @@ GIT_EXTERN(int) git_branch_foreach(
* @return 0 on success, GIT_EINVALIDSPEC or an error code.
*/
GIT_EXTERN(int) git_branch_move(
- git_reference *branch,
- const char *new_branch_name,
- int force);
+ git_reference **out,
+ git_reference *branch,
+ const char *new_branch_name,
+ int force);
/**
* Lookup a branch by its name in a repository.
@@ -136,10 +138,10 @@ GIT_EXTERN(int) git_branch_move(
* exists, GIT_EINVALIDSPEC, otherwise an error code.
*/
GIT_EXTERN(int) git_branch_lookup(
- git_reference **out,
- git_repository *repo,
- const char *branch_name,
- git_branch_t branch_type);
+ git_reference **out,
+ git_repository *repo,
+ const char *branch_name,
+ git_branch_t branch_type);
/**
* Return the name of the given local or remote branch.
@@ -172,8 +174,8 @@ GIT_EXTERN(int) git_branch_name(const char **out,
* reference exists, otherwise an error code.
*/
GIT_EXTERN(int) git_branch_tracking(
- git_reference **out,
- git_reference *branch);
+ git_reference **out,
+ git_reference *branch);
/**
* Return the name of the reference supporting the remote tracking branch,
@@ -208,7 +210,7 @@ GIT_EXTERN(int) git_branch_tracking_name(
* error code otherwise.
*/
GIT_EXTERN(int) git_branch_is_head(
- git_reference *branch);
+ git_reference *branch);
/**
* Return the name of remote that the remote tracking branch belongs to.