From 666b6e1135c12925efe608c4d5f03234c54e2d0c Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Thu, 23 Feb 2023 20:55:01 +0000 Subject: rebase -i: fix parsing of "fixup -C" If the user omits the space between "-C" and the commit in a fixup command then it is parsed as an ordinary fixup and the commit message is not updated as it should be. Fix this by making the space between "-C" and "" optional as it is for the "merge" command. Note that set_replace_editor() is changed to set $GIT_SEQUENCE_EDITOR instead of $EDITOR in order to be able to replace the todo list and reword commits with $FAKE_COMMIT_MESSAGE. This is safe as all the existing users are using set_replace_editor() to replace the todo list. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- t/test-lib-functions.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't/test-lib-functions.sh') diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 796093a7b3..c249fc8aba 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -32,6 +32,14 @@ test_set_editor () { export EDITOR } +# Like test_set_editor but sets GIT_SEQUENCE_EDITOR instead of EDITOR +test_set_sequence_editor () { + FAKE_SEQUENCE_EDITOR="$1" + export FAKE_SEQUENCE_EDITOR + GIT_SEQUENCE_EDITOR='"$FAKE_SEQUENCE_EDITOR"' + export GIT_SEQUENCE_EDITOR +} + test_decode_color () { awk ' function name(n) { -- cgit v1.3-5-g9baa