Re: [PATCHv3] clone: fix refspec on "--single-branch" option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 14, 2012, 22:45 UTC
- Message-ID
- <7vy5kc1avx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1347657228-16404-1-git-send-email-ralf.thielow@gmail.com>
Ralf Thielow <ralf.thielow@gmail.com> writes:
Show 11 quoted lines
> + 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.