t3404-rebase-interactive: test abbreviated commands
Make sure that each short command is tested at least once. To not exacerbate the runtime of the test script, do not add new tests, but modify existing ones according to these criteria: - The test does not have a prerequisite. - The 'git rebase' command is not guarded by test_must_fail. The pick commands are optional in the FAKE_LINES variable, but when used, they do end up in the insn sheet. Test them, too. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Oct 27, 2018 at 10:08 UTC
8c64bc942056eeb5eab467e1f99394f66be0796a
2 files changed
+7
-7
t/lib-rebase.sh
+2
-2
@@ -47,9 +47,9 @@ set_fake_editor () {
47
action=pick
48
for line in $FAKE_LINES; do
49
case $line in
50
- pick|squash|fixup|edit|reword|drop)
50
+ pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d)
51
action="$line";;
52
- exec*)
52
+ exec_*|x_*)
53
echo "$line" | sed 's/_/ /g' >> "$1";;
54
"#")
55
echo '# comment' >> "$1";;
t/t3404-rebase-interactive.sh
+5
-5
@@ -114,7 +114,7 @@ test_expect_success 'rebase -i with exec allows git commands in subdirs' '
114
git checkout master &&
115
mkdir subdir && (cd subdir &&
116
set_fake_editor &&
117
- FAKE_LINES="1 exec_cd_subdir_&&_git_rev-parse_--is-inside-work-tree" \
117
+ FAKE_LINES="1 x_cd_subdir_&&_git_rev-parse_--is-inside-work-tree" \
118
git rebase -i HEAD^
119
)
120
'
@@ -499,7 +499,7 @@ test_expect_success 'squash works as expected' '
499
git checkout -b squash-works no-conflict-branch &&
500
one=$(git rev-parse HEAD~3) &&
501
set_fake_editor &&
502
- FAKE_LINES="1 squash 3 2" EXPECT_HEADER_COUNT=2 \
502
+ FAKE_LINES="1 s 3 2" EXPECT_HEADER_COUNT=2 \
503
git rebase -i HEAD~3 &&
504
test $one = $(git rev-parse HEAD~2)
505
'
@@ -732,7 +732,7 @@ test_expect_success 'reword' '
732
git show HEAD^ | grep "D changed" &&
733
FAKE_LINES="reword 1 2 3 4" FAKE_COMMIT_MESSAGE="B changed" git rebase -i A &&
734
git show HEAD~3 | grep "B changed" &&
735
- FAKE_LINES="1 reword 2 3 4" FAKE_COMMIT_MESSAGE="C changed" git rebase -i A &&
735
+ FAKE_LINES="1 r 2 pick 3 p 4" FAKE_COMMIT_MESSAGE="C changed" git rebase -i A &&
736
git show HEAD~2 | grep "C changed"
737
'
738
@@ -758,7 +758,7 @@ test_expect_success 'rebase -i can copy notes over a fixup' '
758
git reset --hard n3 &&
759
git notes add -m"an earlier note" n2 &&
760
set_fake_editor &&
761
- GIT_NOTES_REWRITE_MODE=concatenate FAKE_LINES="1 fixup 2" git rebase -i n1 &&
761
+ GIT_NOTES_REWRITE_MODE=concatenate FAKE_LINES="1 f 2" git rebase -i n1 &&
762
git notes show > output &&
763
test_cmp expect output
764
'
@@ -1208,7 +1208,7 @@ rebase_setup_and_clean () {
1208
test_expect_success 'drop' '
1209
rebase_setup_and_clean drop-test &&
1210
set_fake_editor &&
1211
- FAKE_LINES="1 drop 2 3 drop 4 5" git rebase -i --root &&
1211
+ FAKE_LINES="1 drop 2 3 d 4 5" git rebase -i --root &&
1212
test E = $(git cat-file commit HEAD | sed -ne \$p) &&
1213
test C = $(git cat-file commit HEAD^ | sed -ne \$p) &&
1214
test A = $(git cat-file commit HEAD^^ | sed -ne \$p)