am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
[gitweb.git] / t / t3415-rebase-autosquash.sh
index 41370ab998c72e14f269a257304b3e0cc4aebc8c..8f53e54ce4176fd0697e8af60a105d40dc161a12 100755 (executable)
@@ -250,4 +250,25 @@ test_expect_success 'squash! fixup!' '
        test_auto_fixup_fixup squash fixup
 '
 
+test_expect_success 'autosquash with custom inst format' '
+       git reset --hard base &&
+       git config --add rebase.instructionFormat "[%an @ %ar] %s"  &&
+       echo 2 >file1 &&
+       git add -u &&
+       test_tick &&
+       git commit -m "squash! $(git rev-parse --short HEAD^)" &&
+       echo 1 >file1 &&
+       git add -u &&
+       test_tick &&
+       git commit -m "squash! $(git log -n 1 --format=%s HEAD~2)" &&
+       git tag final-squash-instFmt &&
+       test_tick &&
+       git rebase --autosquash -i HEAD~4 &&
+       git log --oneline >actual &&
+       test_line_count = 3 actual &&
+       git diff --exit-code final-squash-instFmt &&
+       test 1 = "$(git cat-file blob HEAD^:file1)" &&
+       test 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)
+'
+
 test_done