git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add option -b/--branch to clone for select a new HEAD

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Aug 26, 2009, 16:56 UTC
Message-ID
<20090826165618.GA7477@atjola.homenet>
In-Reply-To
<20090826161059.GC32741@coredump.intra.peff.net>
On 2009.08.26 12:10:59 -0400, Jeff King wrote:
Show 11 quoted lines
> So I think the code should probably look like this (totally untested):
> 
>   remote_head = find_ref_by_name(refs, "HEAD");
>   if (option_branch) {
>           strbuf_addf(&branch_head, "%s%s", src_ref_prefix, option_branch);
>           head_points_at = find_ref_by_name(refs, branch_head.buf);
>           if (!head_points_at)
>                   warning("remote branch not found, etc");
>   }
>   if (!head_points_at)
>     head_points_at = guess_remote_head(remote_head, mapped_refs, 0);

Hm, why "refs" for find_ref_by_name(), but "mapped_ref" for guess_remote_head()?

Björn
Previous: Jeff KingNext: Jeff King
Message 13 of 15 in “Add option -b/--branch to clone for select a new HEAD”
  1. Add option -b/--branch to clone for select a new HEADKirill A. Korinskiy, Aug 25, 2009
  2. Add option -b/--branch to clone for select a new HEADKirill A. Korinskiy, Aug 25, 2009
  3. Jeff KingAug 25, 2009
  4. Junio C HamanoAug 25, 2009
  5. Björn SteinbrinkAug 25, 2009
  6. Tor Arne VestbøAug 28, 2009
  7. Martin LanghoffAug 28, 2009
  8. Julian PhillipsAug 28, 2009
  9. Björn SteinbrinkAug 26, 2009
  10. Add option -b/--branch to clone for select a new HEADKirill A. Korinskiy, Aug 26, 2009
  11. Björn SteinbrinkAug 26, 2009
  12. Jeff KingAug 26, 2009
  13. Björn SteinbrinkAug 26, 2009
  14. Jeff KingAug 26, 2009
  15. Jeff KingAug 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.