summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2026-06-23 16:53:57 +0100
committerJunio C Hamano <gitster@pobox.com>2026-06-23 12:18:48 -0700
commit6f34e5f9e3b664fcd65a2a0695dff16b0ee04b35 (patch)
treecb29ac3141a11a923f473874b229c92a55950440 /t/t4013/diff.diff_initial..side
parent10c2678a2bfbd2a3e8d0a3623d1b71b6cc916253 (diff)
status: improve rebase todo list parsing
When there is rebase in progress "git status" displays the last couple of completed and the next couple of pending commands from the todo list. When it does this it tries to abbreviate the object ids of the commits to be picked. Unfortunately it does not abbreviate the object ids when the line starts with "fixup -C" or "merge -C". It also mistakenly replaces the refname in "reset main" and "update-ref refs/heads/main" with the object id that the ref points to. Fix this by using the function added in the last commit to parse the command name and only try to abbreviate the argument for commands that take an object id. If a command accepts a label then try to resolve the object name as a label first and only if that fails try to resolve it as an object_id. When trying to abbreviate an object id, only replace the object name if it starts with the abbreviated object id so that tag or branch names that contain only hex digits are left unchanged. Comments are now processed after stripping any leading whitespace from the line. This matches what the sequencer does in parse_insn_line(). The existing test cases are updated to test a wider variety of commands. Only the pending commands in the tests are changed to avoid removing existing coverage. Helped-by: Elijah Newren <newren@gmail.com> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions