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

Re: [PATCH resend] builtin/clone: fix segfault when using --revision on some servers

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2026, 16:10 UTC
Message-ID
<xmqqfr19lmau.fsf@gitster.g>
In-Reply-To
<xmqqmrvhlnjv.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> I do not know offhand if that is the case, but if it is always wrong
> for guess_remote_head() to return a guessed ref with NULL in its
> '.peer_ref' member, perhaps that would be a better location to make
> this fix.  What do you think?

Never mind, scratch that part. If we are fetching without storing the result in any remote-tracking ref, '.peer_ref' is legitimately NULL, and if we are storing, '.peer_ref' names the local ref where we store the result. This should not affect our guess as to which of their branches may be pointed to by their 'HEAD'.

So this patch fixes the issue in the right place. It would still be nice to have a new test to prevent future regressions, though.

Thanks.
Previous: Junio C HamanoNext: Adrian Friedli
Message 3 of 6 in “builtin/clone: fix segfault when using --revision on some servers”
  1. builtin/clone: fix segfault when using --revision on some serversAdrian Friedli, Jul 23, 2026
  2. Junio C HamanoJul 23, 2026
  3. Junio C HamanoJul 23, 2026
  4. Adrian FriedliJul 24, 2026
  5. Junio C HamanoJul 24, 2026
  6. builtin/clone: fix segfault when using --revision with protocol v0Adrian Friedli, Jul 24, 2026

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.