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 argumentsmaint
commit
85fcf1cbb6
|
@ -1994,7 +1994,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)) {
|
if (skip_prefix(bol, todo_command_info[i].str, &bol)) {
|
||||||
item->command = i;
|
item->command = i;
|
||||||
break;
|
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++;
|
bol++;
|
||||||
item->command = i;
|
item->command = i;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -49,7 +49,7 @@ set_fake_editor () {
|
||||||
case $line in
|
case $line in
|
||||||
pick|squash|fixup|edit|reword|drop)
|
pick|squash|fixup|edit|reword|drop)
|
||||||
action="$line";;
|
action="$line";;
|
||||||
exec*|break)
|
exec*|break|b)
|
||||||
echo "$line" | sed 's/_/ /g' >> "$1";;
|
echo "$line" | sed 's/_/ /g' >> "$1";;
|
||||||
"#")
|
"#")
|
||||||
echo '# comment' >> "$1";;
|
echo '# comment' >> "$1";;
|
||||||
|
|
|
@ -245,7 +245,9 @@ unset GIT_SEQUENCE_EDITOR
|
||||||
|
|
||||||
test_expect_success 'the todo command "break" works' '
|
test_expect_success 'the todo command "break" works' '
|
||||||
rm -f execed &&
|
rm -f execed &&
|
||||||
FAKE_LINES="break exec_>execed" git rebase -i HEAD &&
|
FAKE_LINES="break b exec_>execed" git rebase -i HEAD &&
|
||||||
|
test_path_is_missing execed &&
|
||||||
|
git rebase --continue &&
|
||||||
test_path_is_missing execed &&
|
test_path_is_missing execed &&
|
||||||
git rebase --continue &&
|
git rebase --continue &&
|
||||||
test_path_is_file execed
|
test_path_is_file execed
|
||||||
|
|
Loading…
Reference in New Issue