diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-01-13 10:54:36 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-01-13 05:41:16 -0800 |
| commit | 48a72f61f04cb2357544f373677acd5b4149237e (patch) | |
| tree | 9da53796033c4e5d77ac3e548774305d1b24e3e4 /contrib/persistent-https | |
| parent | 5425771568ee286ed7ee848b8886cfdc98806b7a (diff) | |
| download | git-48a72f61f04cb2357544f373677acd5b4149237e.tar.gz git-48a72f61f04cb2357544f373677acd5b4149237e.zip | |
replay: support updating detached HEAD
In a subsequent commit we're about to introduce a new git-history(1)
command, which will by default work on all local branches and HEAD. This
is already well-supported by the replay machinery for most of the part:
updating branches is one of its prime use cases, and the HEAD ref is
also updated in case it points to any of the branches.
However, what's not supported yet is to update HEAD in case it is not a
symbolic ref. We determine the refs that need to be updated by iterating
through the decorations of the original commit, but we only update those
refs that are `DECORATION_REF_LOCAL`, which covers local branches.
Address this gap by also handling `DECORATION_REF_HEAD`. Note though
that this needs to only happen in case we're working on a detached HEAD.
If HEAD is pointing to a branch, then we'd already update that branch
via `DECORATION_REF_LOCAL`.
Refactor the loop that iterates through the decorations a bit to make
the individual conditions easier to understand.
Based-on-patch-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions
