]> git.ipfire.org Git - thirdparty/git.git/commit
rebase: ignore non-branch update-refs
authorAbhinav Gupta <mail@abhinavg.net>
Sun, 10 May 2026 22:41:11 +0000 (15:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 May 2026 00:00:44 +0000 (09:00 +0900)
commit106b6885c7bbaafc863dff0bb5361f906545de5c
treee25d82af9544183803c8bedf7b7076ba01f053ef
parent67ad42147a7acc2af6074753ebd03d904476118f
rebase: ignore non-branch update-refs

The following Git configuration breaks git rebase --update-refs:

    [rebase]
        instructionFormat = %s%d

The '%d' format requests all available decorations for a commit,
filling the global decoration table with all of them,
which --update-refs then uses to populate 'update-ref' instructions
in the rebase todo list.

Specifically, this results in the following instruction:

    update-ref HEAD

The todo parser then rejects the instruction:

    error: update-ref requires a fully qualified refname e.g. refs/heads/HEAD
    error: invalid line 3: update-ref HEAD

To fix, ignore decorations that are not local branches
when scanning through the table.

This matches the documented contract:
it moves branch refs under refs/heads/
and leaves display-only decorations (HEAD, tags, etc.) alone.

Verification:
A regression test that fails without this fix is included.

Signed-off-by: Abhinav Gupta <mail@abhinavg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3404-rebase-interactive.sh