@ -1340,6 +1340,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
our_head_points_at = remote_head_points_at;
our_head_points_at = remote_head_points_at;
}
}
else {
else {
const char *branch;
char *ref;
if (option_branch)
if (option_branch)
die(_("Remote branch %s not found in upstream %s"),
die(_("Remote branch %s not found in upstream %s"),
option_branch, remote_name);
option_branch, remote_name);
@ -1350,9 +1353,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
remote_head_points_at = NULL;
remote_head_points_at = NULL;
remote_head = NULL;
remote_head = NULL;
option_no_checkout = 1;
option_no_checkout = 1;
if (!option_bare) {
const char *branch;
char *ref;
if (transport_ls_refs_options.unborn_head_target &&
if (transport_ls_refs_options.unborn_head_target &&
skip_prefix(transport_ls_refs_options.unborn_head_target,
skip_prefix(transport_ls_refs_options.unborn_head_target,
@ -1365,10 +1365,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
ref = xstrfmt("refs/heads/%s", branch);
ref = xstrfmt("refs/heads/%s", branch);
}
}
if (!option_bare)
install_branch_config(0, branch, remote_name, ref);
install_branch_config(0, branch, remote_name, ref);
free(ref);
free(ref);
}
}
}
write_refspec_config(src_ref_prefix, our_head_points_at,
write_refspec_config(src_ref_prefix, our_head_points_at,
remote_head_points_at, &branch_top);
remote_head_points_at, &branch_top);