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

Re: [PATCH] fetch: Fix segfault on pull --set-upstream outside a branch.

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 6, 2021, 18:03 UTC
Message-ID
<CAPig+cTRXTGe-MNTy=2gk1eX8G+0fa303nrLnEtX1uHUC2usmg@mail.gmail.com>
In-Reply-To
<xmqq1r8bl40i.fsf@gitster.g>
On Tue, Jul 6, 2021 at 1:57 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Clemens Fruhwirth <clemens@endorphin.org> writes:
>
> > branch_get("HEAD") can return NULL, when we are outside a branch and
> > the user calls pull --set-upstream. Catch this case and warn the user
> > to avoid a segfault.
>
> Nit.  What do you mean by "outside a branch"?  If you mean "when the
> HEAD is detached", please say so, and use the same terminology in
> your warning message.

Also, adding a new test, probably to `t/t5553-set-upstream.sh`, would be welcome. The test can likely be as simple as ensuring that the command does not crash, and perhaps check that the outcome was as expected.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “fetch: Fix segfault on pull --set-upstream outside a branch.”
  1. fetch: Fix segfault on pull --set-upstream outside a branch.Clemens Fruhwirth, Jul 6, 2021
  2. Junio C HamanoJul 6, 2021
  3. Eric SunshineJul 6, 2021
  4. Junio C HamanoJul 6, 2021
  5. Junio C HamanoJul 6, 2021

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.