summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2018-10-25 20:47:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-26 01:20:23 (GMT)
commit3a4a4cab3ef024e10af7a5bbcaed4b961c60f1db (patch)
tree845fa7bba14ed40fbc833f3f7a999a684ffd1557 /sequencer.c
parent71f82465b1c9546a09c442c3c9aa22ecbb76f820 (diff)
downloadgit-3a4a4cab3ef024e10af7a5bbcaed4b961c60f1db.zip
git-3a4a4cab3ef024e10af7a5bbcaed4b961c60f1db.tar.gz
git-3a4a4cab3ef024e10af7a5bbcaed4b961c60f1db.tar.bz2
rebase -i: recognize short commands without arguments
The sequencer instruction 'b', short for 'break', is rejected: error: invalid line 2: b The reason is that the parser expects all short commands to have an argument. Permit short commands without arguments. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index ee3961e..3107f59 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1954,7 +1954,8 @@ static int parse_insn_line(struct todo_item *item, const char *bol, char *eol)
if (skip_prefix(bol, todo_command_info[i].str, &bol)) {
item->command = i;
break;
- } else if (bol[1] == ' ' && *bol == todo_command_info[i].c) {
+ } else if ((bol + 1 == eol || bol[1] == ' ') &&
+ *bol == todo_command_info[i].c) {
bol++;
item->command = i;
break;