X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft3404-rebase-interactive.sh;h=ee9a1b25e6a35adcb2350068d3b63b50bc9c24b3;hb=73e25e7cc80e175b5c94678188333e42107fa16e;hp=f20ea38411d0ca67709dbde0bfd1108e28c0dd71;hpb=6774e2bf0822cd4358620d3e806f9b3df8bd777e;p=git.git diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index f20ea3841..ee9a1b25e 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -146,6 +146,16 @@ test_expect_success 'abort' ' ! test -d .git/rebase-merge ' +test_expect_success 'abort with error when new base cannot be checked out' ' + git rm --cached file1 && + git commit -m "remove file in base" && + test_must_fail git rebase -i master > output 2>&1 && + grep "Untracked working tree file .file1. would be overwritten" \ + output && + ! test -d .git/rebase-merge && + git reset --hard HEAD^ +' + test_expect_success 'retain authorship' ' echo A > file7 && git add file7 && @@ -181,6 +191,12 @@ test_expect_success '-p handles "no changes" gracefully' ' test $HEAD = $(git rev-parse HEAD) ' +test_expect_failure 'exchange two commits with -p' ' + FAKE_LINES="2 1" git rebase -i -p HEAD~2 && + test H = $(git cat-file commit HEAD^ | sed -ne \$p) && + test G = $(git cat-file commit HEAD | sed -ne \$p) +' + test_expect_success 'preserve merges with -p' ' git checkout -b to-be-preserved master^ && : > unrelated-file &&