Commit 12f831fa by Vicent Martí

Merge pull request #1586 from jamill/fetch_fix

Fetch should not fail when remote HEAD reference is not present locally
parents 54e489c2 6fe02c11
...@@ -870,19 +870,6 @@ static int update_tips_for_spec(git_remote *remote, git_refspec *spec, git_vecto ...@@ -870,19 +870,6 @@ static int update_tips_for_spec(git_remote *remote, git_refspec *spec, git_vecto
if (git_vector_init(&update_heads, 16, NULL) < 0) if (git_vector_init(&update_heads, 16, NULL) < 0)
return -1; return -1;
/* Let's go find HEAD, if it exists. Check only the first ref in the vector. */
if (refs->length > 0) {
head = git_vector_get(refs, 0);
if (!strcmp(head->name, GIT_HEAD_FILE)) {
if (git_reference_create(&ref, remote->repo, GIT_FETCH_HEAD_FILE, &head->oid, 1) < 0)
goto on_error;
i = 1;
git_reference_free(ref);
}
}
for (; i < refs->length; ++i) { for (; i < refs->length; ++i) {
head = git_vector_get(refs, i); head = git_vector_get(refs, i);
autotag = 0; autotag = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment