]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3415-rebase-autosquash.sh
rebase --autosquash: fix a potential segfault
[thirdparty/git.git] / t / t3415-rebase-autosquash.sh
index 13f5688135d853106702b7679eb302f6ae3d1450..03983b3489369afa52d38d0e51dee8eaa4ad84da 100755 (executable)
@@ -349,4 +349,20 @@ test_expect_success 'abort last squash' '
        ! grep first actual
 '
 
+test_expect_success 'fixup a fixup' '
+       echo 0to-fixup >file0 &&
+       test_tick &&
+       git commit -m "to-fixup" file0 &&
+       test_tick &&
+       git commit --squash HEAD -m X --allow-empty &&
+       test_tick &&
+       git commit --squash HEAD^ -m Y --allow-empty &&
+       test_tick &&
+       git commit -m "squash! $(git rev-parse HEAD^)" -m Z --allow-empty &&
+       test_tick &&
+       git commit -m "squash! $(git rev-parse HEAD^^)" -m W --allow-empty &&
+       git rebase -ki --autosquash HEAD~5 &&
+       test XZWY = $(git show | tr -cd W-Z)
+'
+
 test_done