Re: [PATCH v5 06/10] reset: introduce ability to skip updating HEAD
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 11, 2026, 18:00 UTC
- Message-ID
- <xmqq33ytneiu.fsf@gitster.g>
- In-Reply-To
- <20260611-b4-pks-history-drop-v5-6-34d35725559c@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 25 quoted lines
> 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 <phillip.wood123@gmail.com>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> 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?