Skip to content

Commit

Permalink
Add GIT_BRANCH_ALL to git_branch_t enum
Browse files Browse the repository at this point in the history
git_branch_t is an enum so requesting GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE is not possible as it is not a member of the enum (at least VS2013 C++ complains about it).

This fixes a regression introduced in commit a667ca8 (PR #1946).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
  • Loading branch information
csware committed Apr 16, 2014
1 parent 37ab5ec commit fa13ee2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/git2/branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef struct git_branch_iterator git_branch_iterator;
* @param repo Repository where to find the branches.
* @param list_flags Filtering flags for the branch
* listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE
* or a combination of the two.
* or GIT_BRANCH_ALL.
*
* @return 0 on success or an error code
*/
Expand Down
1 change: 1 addition & 0 deletions include/git2/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ typedef enum {
typedef enum {
GIT_BRANCH_LOCAL = 1,
GIT_BRANCH_REMOTE = 2,
GIT_BRANCH_ALL = GIT_BRANCH_LOCAL|GIT_BRANCH_REMOTE,
} git_branch_t;

/** Valid modes for index and tree entries. */
Expand Down
4 changes: 2 additions & 2 deletions tests/refs/branches/iterator.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void assert_retrieval(unsigned int flags, unsigned int expected_count)

void test_refs_branches_iterator__retrieve_all_branches(void)
{
assert_retrieval(GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE, 14);
assert_retrieval(GIT_BRANCH_ALL, 14);
}

void test_refs_branches_iterator__retrieve_remote_branches(void)
Expand Down Expand Up @@ -139,7 +139,7 @@ void test_refs_branches_iterator__mix_of_packed_and_loose(void)

r2 = cl_git_sandbox_init("testrepo2");

cl_git_pass(git_branch_iterator_new(&iter, r2, GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE));
cl_git_pass(git_branch_iterator_new(&iter, r2, GIT_BRANCH_ALL));
contains_branches(exp, iter);

git_branch_iterator_free(iter);
Expand Down

0 comments on commit fa13ee2

Please sign in to comment.