Skip to content

Commit 1795993

Browse files
liambeguingitster
authored andcommitted
t3404: add test case for abbreviated commands
Make sure the todo list ends up using single-letter command abbreviations when the rebase.abbreviateCommands is enabled. This configuration option should not change anything else. Signed-off-by: Liam Beguin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d8ae6c8 commit 1795993

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,28 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
12601260
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
12611261
'
12621262

1263+
test_expect_success 'respects rebase.abbreviateCommands with fixup, squash and exec' '
1264+
rebase_setup_and_clean abbrevcmd &&
1265+
test_commit "first" file1.txt "first line" first &&
1266+
test_commit "second" file1.txt "another line" second &&
1267+
test_commit "fixup! first" file2.txt "first line again" first_fixup &&
1268+
test_commit "squash! second" file1.txt "another line here" second_squash &&
1269+
cat >expected <<-EOF &&
1270+
p $(git rev-list --abbrev-commit -1 first) first
1271+
f $(git rev-list --abbrev-commit -1 first_fixup) fixup! first
1272+
x git show HEAD
1273+
p $(git rev-list --abbrev-commit -1 second) second
1274+
s $(git rev-list --abbrev-commit -1 second_squash) squash! second
1275+
x git show HEAD
1276+
EOF
1277+
git checkout abbrevcmd &&
1278+
set_cat_todo_editor &&
1279+
test_config rebase.abbreviateCommands true &&
1280+
test_must_fail git rebase -i --exec "git show HEAD" \
1281+
--autosquash master >actual &&
1282+
test_cmp expected actual
1283+
'
1284+
12631285
test_expect_success 'static check of bad command' '
12641286
rebase_setup_and_clean bad-cmd &&
12651287
set_fake_editor &&

0 commit comments

Comments
 (0)