Re: [PATCH v3 5/5] builtin/stash: merge index in-core
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 28, 2026, 09:40 UTC
- Message-ID
- <xmqqmrt1pvd1.fsf@gitster.g>
- In-Reply-To
- <fde7fb7988b695707c6f2776adc18eec7fe4696a.1790425008.git.ben.knoble@gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
> + merge_incore_nonrecursive(&o, merge_base, head, merge, > + &result); > + > + oidcpy(&index_tree, &result.tree->object.oid);
This is risky, isn't it?
If there were catastrophic failure (e.g., missing object that were involved in the merge), merge_incore_nonrecursive() may stuff -1 to result.clean and return without populating result.tree, and when that happens, result.tree->object.oid would be dereferencing NULL.