Re: [PATCH 5/5] t3404: add test case for abbreviated commands
From: Junio C Hamano <hidden>
Date: 2017-11-27 05:28:35
Liam Beguin [off-list ref] writes:
quoted hunk
Make sure the todo list ends up using single-letter command abbreviations when the rebase.abbreviateCommands is enabled. This configuration options should not change anything else. Signed-off-by: Liam Beguin <redacted> --- t/t3404-rebase-interactive.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 6a82d1ed876d..e460ebde3393 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh@@ -1260,6 +1260,38 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' ' test B = $(git cat-file commit HEAD^ | sed -ne \$p) ' +test_expect_success 'prepare rebase.abbreviateCommands' ' + reset_rebase && + git checkout -b abbrevcmd master && + test_commit "first" file1.txt "first line" first && + test_commit "second" file1.txt "another line" second && + test_commit "fixup! first" file2.txt "first line again" first_fixup && + test_commit "squash! second" file1.txt "another line here" second_squash +' + +cat >expected <<EOF && +p $(git rev-list --abbrev-commit -1 first) first +f $(git rev-list --abbrev-commit -1 first_fixup) fixup! first +x git show HEAD +p $(git rev-list --abbrev-commit -1 second) second +s $(git rev-list --abbrev-commit -1 second_squash) squash! second +x git show HEAD +EOF
Please have this cat inside and at the beginning of the next
test_expect_success, preferably indented with HT to align with other
commands (adding '-' to the opening of your here-document makes the
shell strip all leading HTs from the here-document), like this:
test_expect_success 'respects rebase....' '
cat expect <<-EOF &&
p $(git rev-list ...)
f $(git rev-list ...)
...
EOF
test_when_finished "
...
" &&
...
test_cmp expect actual
'