diff --git a/sequencer.c b/sequencer.c index 416412ca33..3c34e70872 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2532,12 +2532,10 @@ static int parse_insn_line(struct repository *r, struct todo_item *item, } if (item->command == TODO_FIXUP) { - if (skip_prefix(bol, "-C", &bol) && - (*bol == ' ' || *bol == '\t')) { + if (skip_prefix(bol, "-C", &bol)) { bol += strspn(bol, " \t"); item->flags |= TODO_REPLACE_FIXUP_MSG; - } else if (skip_prefix(bol, "-c", &bol) && - (*bol == ' ' || *bol == '\t')) { + } else if (skip_prefix(bol, "-c", &bol)) { bol += strspn(bol, " \t"); item->flags |= TODO_EDIT_FIXUP_MSG; } diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index 1d2f0429ae..7ca5b918f0 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -211,6 +211,9 @@ check_reworded_commits () { # usage: set_replace_editor # # Replace the todo file with the exact contents of the given file. +# N.B. sets GIT_SEQUENCE_EDITOR rather than EDITOR so it can be +# combined with set_fake_editor to reword commits and replace the +# todo list set_replace_editor () { cat >script <<-\EOF && cat FILENAME >"$1" @@ -219,6 +222,7 @@ set_replace_editor () { cat "$1" EOF - sed -e "s/FILENAME/$1/g"