]> git.ipfire.org Git - thirdparty/git.git/commit
rebase -i: check labels and refs when parsing todo list
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Mon, 20 Feb 2023 14:19:34 +0000 (14:19 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Feb 2023 17:18:37 +0000 (09:18 -0800)
commit16b3880dd7e617f909b2a3bc3672e29a897842bd
treecd864773e507e3d3d2ac1cdf852ef22d2c1bbc15
parentd9d677b2d8cc5f70499db04e633ba7a400f64cbf
rebase -i: check labels and refs when parsing todo list

Check that the argument to the "label" and "update-ref" commands is a
valid refname when the todo list is parsed rather than waiting until the
command is executed. This means that the user can deal with any errors
at the beginning of the rebase rather than having it stop halfway
through due to a typo in a label name. The "update-ref" command is
changed to reject single level refs as it is all to easy to type
"update-ref branch" which is incorrect rather than "update-ref
refs/heads/branch"

Note that it is not straight forward to check the arguments to "reset"
and "merge" commands as they may be any revision, not just a refname and
we do not have an equivalent of check_refname_format() for revisions.

Helped-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3404-rebase-interactive.sh