if ((error = git_refspec__parse(&head, "HEAD", true)) < 0)
goto cleanup;
- if ((error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs)) < 0)
+ error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs);
+ git_refspec__free(&head);
+
+ if (error < 0)
goto cleanup;
}
assert(remote);
- if (git_vector_init(&refs, 8, remote_head_cmp) < 0)
- return -1;
-
if (git_remote_ls((const git_remote_head ***)&refs.contents, &refs.length, remote) < 0)
return -1;
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0)
return -1;
- if (git_vector_init(&refs, 16, NULL) < 0)
- return -1;
-
if ((error = git_remote_ls((const git_remote_head ***)&refs.contents, &refs.length, remote)) < 0)
goto out;