{
git_reference_iterator *iter;
git_reference *ref;
- int error;
+ int error = 0;
if (git_reference_iterator_new(&iter, repo) < 0)
return -1;
- while ((error = git_reference_next(&ref, iter)) == 0) {
+ while (!error && (error = git_reference_next(&ref, iter)) == 0) {
if (list_flags & GIT_BRANCH_LOCAL &&
git__prefixcmp(ref->name, GIT_REFS_HEADS_DIR) == 0) {
if (callback(ref->name + strlen(GIT_REFS_HEADS_DIR),
GIT_BRANCH_LOCAL, payload)) {
error = GIT_EUSER;
- break;
}
}
if (callback(ref->name + strlen(GIT_REFS_REMOTES_DIR),
GIT_BRANCH_REMOTE, payload)) {
error = GIT_EUSER;
- break;
}
}
cl_git_pass(git_branch_foreach(repo, GIT_BRANCH_REMOTE, contains_branch_list_cb, &exp));
assert_branch_has_been_found(exp, "nulltoken/HEAD");
- assert_branch_has_been_found(exp, "nulltoken/HEAD");
+ assert_branch_has_been_found(exp, "nulltoken/master");
}
static int branch_list_interrupt_cb(