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

Re: [PATCH] checkout -p: handle tree arguments correctly again

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2020, 17:34 UTC
Message-ID
<xmqqczz5punk.fsf@gitster.c.googlers.com>
In-Reply-To
<X94WHmY3Cd30wqan@generichostname>
Denton Liu <liu.denton@gmail.com> writes:
Show 20 quoted lines
> Hi Dscho,
>
> On Sat, Dec 19, 2020 at 02:55:59PM +0000, Johannes Schindelin via GitGitGadget wrote:
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>> 
>> This fixes a segmentation fault.
>> 
>> The bug is caused by dereferencing `new_branch_info->commit` when it is
>> `NULL`, which is the case when the tree-ish argument is actually a tree,
>> not a commit-ish. This was introduced in 5602b500c3c (builtin/checkout:
>> fix `git checkout -p HEAD...` bug, 2020-10-07), where we tried to ensure
>> that the special tree-ish `HEAD...` is handled correctly.
>> 
>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> Argh, thanks for catching this. The patch looks obviously good.
>
> Since I'm the one who introduced the bug in the first place:
>
> 	Acked-by: Denton Liu <liu.denton@gmail.com>
The fix looks obviously correct to me.  Thanks, both.
Will queue for fast-tracking.
Previous: Denton LiuNext: Junio C Hamano
Message 3 of 4 in “checkout -p: handle tree arguments correctly again”
  1. checkout -p: handle tree arguments correctly againJohannes Schindelin via GitGitGadget, Dec 19, 2020
  2. Denton LiuDec 19, 2020
  3. Junio C HamanoDec 19, 2020
  4. Junio C HamanoDec 19, 2020

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.