Re: [PATCHv3] clone: fix refspec on "--single-branch" option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ralf Thielow <ralf.thielow@xxxxxxxxx> writes:

> +	if (option_mirror || !option_bare) {
> +		strbuf_reset(&value);
> +		if (option_single_branch) {
> +			if (option_branch)
> +				strbuf_addf(&value, "+%s%s:%s%s",
> +						src_ref_prefix, option_branch,
> +						branch_top.buf, option_branch);
> +			else if (remote_head_points_at)
> +				strbuf_addf(&value, "+%s:%s%s",
> +						remote_head_points_at->name, branch_top.buf,
> +						skip_prefix(remote_head_points_at->name, "refs/heads/"));

We have already set "remote.origin.url" to this repository, so the
next "git fetch" would simply fetch from "HEAD" per default.
Perhaps worth commenting that here?

Other than that, looks good.  Perhaps we would want a test or two,
too?

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]