Retrieve the next branch from the iterator
the reference
the type of branch (local or remote-tracking)
the branch iterator
0 on success, GIT_ITEROVER if there are no more branches or an error code.