Skip to content

Commit 85fcf1c

Browse files
committed
Merge branch 'js/rebase-i-shortopt'
"git rebase -i" learned to take 'b' as the short form of 'break' option in the todo list. * js/rebase-i-shortopt: rebase -i: recognize short commands without arguments
2 parents 789b1f7 + 3a4a4ca commit 85fcf1c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

sequencer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,8 @@ static int parse_insn_line(struct todo_item *item, const char *bol, char *eol)
19941994
if (skip_prefix(bol, todo_command_info[i].str, &bol)) {
19951995
item->command = i;
19961996
break;
1997-
} else if (bol[1] == ' ' && *bol == todo_command_info[i].c) {
1997+
} else if ((bol + 1 == eol || bol[1] == ' ') &&
1998+
*bol == todo_command_info[i].c) {
19981999
bol++;
19992000
item->command = i;
20002001
break;

t/lib-rebase.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ set_fake_editor () {
4949
case $line in
5050
pick|squash|fixup|edit|reword|drop)
5151
action="$line";;
52-
exec*|break)
52+
exec*|break|b)
5353
echo "$line" | sed 's/_/ /g' >> "$1";;
5454
"#")
5555
echo '# comment' >> "$1";;

t/t3418-rebase-continue.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ unset GIT_SEQUENCE_EDITOR
245245

246246
test_expect_success 'the todo command "break" works' '
247247
rm -f execed &&
248-
FAKE_LINES="break exec_>execed" git rebase -i HEAD &&
248+
FAKE_LINES="break b exec_>execed" git rebase -i HEAD &&
249+
test_path_is_missing execed &&
250+
git rebase --continue &&
249251
test_path_is_missing execed &&
250252
git rebase --continue &&
251253
test_path_is_file execed

0 commit comments

Comments
 (0)