Add branch iterator #66

Merged
jezell merged 9 commits from branch-iterator into master 2014-04-26 13:25:26 -05:00
2 changed files with 2 additions and 4 deletions
Showing only changes of commit a7d3c5955a - Show all commits

View File

@ -53,9 +53,7 @@ func (i *BranchIterator) Next() (*Branch, BranchType, error) {
ecode := C.git_branch_next(&refPtr, &refType, i.ptr)
if ecode == C.GIT_ITEROVER {
return nil, BranchLocal, ErrIterOver
} else if ecode < 0 {
if ecode < 0 {
return nil, BranchLocal, MakeGitError(ecode)
}

View File

@ -20,7 +20,7 @@ func TestBranchIterator(t *testing.T) {
t.Fatalf("expected BranchLocal, not %v", t)
}
b, bt, err = i.Next()
if err != ErrIterOver {
if !IsErrorCode(err, ErrIterOver) {
t.Fatal("expected iterover")
}
}