Skip to content

Commit 8c64bc9

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7afb0d6 commit 8c64bc9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

t/lib-rebase.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ set_fake_editor () {
4747
action=pick
4848
for line in $FAKE_LINES; do
4949
case $line in
50-
pick|squash|fixup|edit|reword|drop)
50+
pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d)
5151
action="$line";;
52-
exec*)
52+
exec_*|x_*)
5353
echo "$line" | sed 's/_/ /g' >> "$1";;
5454
"#")
5555
echo '# comment' >> "$1";;

t/t3404-rebase-interactive.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ test_expect_success 'rebase -i with exec allows git commands in subdirs' '
114114
git checkout master &&
115115
mkdir subdir && (cd subdir &&
116116
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" \
118118
git rebase -i HEAD^
119119
)
120120
'
@@ -499,7 +499,7 @@ test_expect_success 'squash works as expected' '
499499
git checkout -b squash-works no-conflict-branch &&
500500
one=$(git rev-parse HEAD~3) &&
501501
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 \
503503
git rebase -i HEAD~3 &&
504504
test $one = $(git rev-parse HEAD~2)
505505
'
@@ -732,7 +732,7 @@ test_expect_success 'reword' '
732732
git show HEAD^ | grep "D changed" &&
733733
FAKE_LINES="reword 1 2 3 4" FAKE_COMMIT_MESSAGE="B changed" git rebase -i A &&
734734
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 &&
736736
git show HEAD~2 | grep "C changed"
737737
'
738738

@@ -758,7 +758,7 @@ test_expect_success 'rebase -i can copy notes over a fixup' '
758758
git reset --hard n3 &&
759759
git notes add -m"an earlier note" n2 &&
760760
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 &&
762762
git notes show > output &&
763763
test_cmp expect output
764764
'
@@ -1208,7 +1208,7 @@ rebase_setup_and_clean () {
12081208
test_expect_success 'drop' '
12091209
rebase_setup_and_clean drop-test &&
12101210
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 &&
12121212
test E = $(git cat-file commit HEAD | sed -ne \$p) &&
12131213
test C = $(git cat-file commit HEAD^ | sed -ne \$p) &&
12141214
test A = $(git cat-file commit HEAD^^ | sed -ne \$p)

0 commit comments

Comments
 (0)