Re: [PATCH v4 06/10] reset: introduce ability to skip updating HEAD
From: Patrick Steinhardt <hidden>
Date: 2026-06-11 11:47:18
From: Patrick Steinhardt <hidden>
Date: 2026-06-11 11:47:18
On Wed, Jun 10, 2026 at 02:11:04PM +0100, Phillip Wood wrote:
On 10/06/2026 09:52, Patrick Steinhardt wrote:quoted
In a subsequent commit we'll introduce a new caller to `reset_working_tree()` that really only wants to update the index and working tree, without updating any references. Introduce a new flag that makes the caller opt in to updating HEAD and adapt all callers to set that flag. Note that in a previous iteration we instead introduced a flag that made callers opt out of updating any references. This was somewhat awkward though because we already have the `UPDATE_ORIG_HEAD` flag, so the result was somewhat inconsistent.Thanks for doing this. I've grepped for all the callers of reset_head() to confirm this patch adds RESET_HEAD_UPDATE_HEAD to them all. I wonder if we should add a check for passing RESET_HEAD_UPDATE_ORIG_HEAD without RESET_HEAD_UPDATE_HEAD that calls BUG() as we don't support that. Everything else looks good.
Fair, can do. Thanks! Patrick