Thread (1 message) 1 message, 1 author, 2020-12-19

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

From: Junio C Hamano <hidden>
Date: 2020-12-19 17:35:07

Denton Liu [off-list ref] writes:
Hi Dscho,

On Sat, Dec 19, 2020 at 02:55:59PM +0000, Johannes Schindelin via GitGitGadget wrote:
quoted
From: Johannes Schindelin <redacted>

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 <redacted>
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 [off-list ref]
The fix looks obviously correct to me.  Thanks, both.

Will queue for fast-tracking.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help