Commit 32332fcc by Carlos Martín Nieto

clone: don't error out if the branch already exists

We set up the current branch after we fetch from the remote. This means
that the user's refspec may have already created this reference. It is
therefore not an error if we cannot create the branch because it already
exists.

This allows for the user to replicate git-clone's --mirror option.
parent 3c607685
......@@ -171,6 +171,10 @@ static int update_head_to_new_branch(
git_reference_free(tracking_branch);
/* if it already existed, then the user's refspec created it for us, ignore it' */
if (error == GIT_EEXISTS)
error = 0;
return error;
}
......
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