Merge pull request #1946 from arthurschreiber/change-branch-iterator-definition Change the git_branch_iterator_new definition to use git_branch_t
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
diff --git a/include/git2/branch.h b/include/git2/branch.h
index b5e7d60..44d6fd9 100644
--- a/include/git2/branch.h
+++ b/include/git2/branch.h
@@ -83,7 +83,7 @@ typedef struct git_branch_iterator git_branch_iterator;
GIT_EXTERN(int) git_branch_iterator_new(
git_branch_iterator **out,
git_repository *repo,
- unsigned int list_flags);
+ git_branch_t list_flags);
/**
* Retrieve the next branch from the iterator
@@ -93,7 +93,7 @@ GIT_EXTERN(int) git_branch_iterator_new(
* @param iter the branch iterator
* @return 0 on success, GIT_ITEROVER if there are no more branches or an error code.
*/
-GIT_EXTERN(int) git_branch_next(git_reference **out, unsigned int *out_type, git_branch_iterator *iter);
+GIT_EXTERN(int) git_branch_next(git_reference **out, git_branch_t *out_type, git_branch_iterator *iter);
/**
* Free a branch iterator
diff --git a/src/branch.c b/src/branch.c
index 4660f00..95b3fd9 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -129,7 +129,7 @@ typedef struct {
unsigned int flags;
} branch_iter;
-int git_branch_next(git_reference **out, unsigned int *out_type, git_branch_iterator *_iter)
+int git_branch_next(git_reference **out, git_branch_t *out_type, git_branch_iterator *_iter)
{
branch_iter *iter = (branch_iter *) _iter;
git_reference *ref;
@@ -159,7 +159,7 @@ int git_branch_next(git_reference **out, unsigned int *out_type, git_branch_iter
int git_branch_iterator_new(
git_branch_iterator **out,
git_repository *repo,
- unsigned int list_flags)
+ git_branch_t list_flags)
{
branch_iter *iter;
diff --git a/tests-clar/online/push.c b/tests-clar/online/push.c
index 320ecb7..d9ffe8a 100644
--- a/tests-clar/online/push.c
+++ b/tests-clar/online/push.c
@@ -182,7 +182,7 @@ static void verify_tracking_branches(git_remote *remote, expected_ref expected_r
char *actual_ref;
git_oid oid;
int failed = 0, error;
- unsigned int branch_type;
+ git_branch_t branch_type;
git_reference *ref;
/* Get current remote branches */
diff --git a/tests-clar/refs/branches/iterator.c b/tests-clar/refs/branches/iterator.c
index fb2c1a1..904c6a1 100644
--- a/tests-clar/refs/branches/iterator.c
+++ b/tests-clar/refs/branches/iterator.c
@@ -33,7 +33,7 @@ static void assert_retrieval(unsigned int flags, unsigned int expected_count)
git_branch_iterator *iter;
git_reference *ref;
int count = 0, error;
- unsigned int type;
+ git_branch_t type;
cl_git_pass(git_branch_iterator_new(&iter, repo, flags));
while ((error = git_branch_next(&ref, &type, iter)) == 0) {
@@ -83,7 +83,7 @@ static void assert_branch_has_been_found(struct expectations *findings, const ch
static void contains_branches(struct expectations exp[], git_branch_iterator *iter)
{
git_reference *ref;
- unsigned int type;
+ git_branch_t type;
int error, pos = 0;
while ((error = git_branch_next(&ref, &type, iter)) == 0) {