From: Junio C Hamano Date: Thu, 11 Jun 2026 18:00:25 GMT Subject: Re: [PATCH v5 06/10] reset: introduce ability to skip updating HEAD Message-ID: In-Reply-To: <20260611-b4-pks-history-drop-v5-6-34d35725559c@pks.im> Patrick Steinhardt writes: > 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. > > Suggested-by: Phillip Wood > Signed-off-by: Patrick Steinhardt > --- > builtin/rebase.c | 14 ++++++++++---- > reset.c | 9 +++++++-- > reset.h | 9 ++++++--- > sequencer.c | 4 +++- > 4 files changed, 26 insertions(+), 10 deletions(-) > > diff --git a/reset.c b/reset.c > ... > @@ -129,7 +133,7 @@ int reset_working_tree(struct repository *r, > oid = &head_oid; > > if (refs_only) { > - if (!dry_run) > + if (update_head) > return update_refs(r, opts, oid, head); > return 0; > } So when refs_only and update-head are in effect, we will call update_refs(), even if dry_run is given. update_refs() does not seem to pay attention to (opts->flags & RESET_WORKING_TREE_DRY_RUN) at all, so wouldn't this mean that we would update even in a dry-run session?