[PATCH 5/5] Add test for rebase with merges amd redundant commits
- From
David Greene <greened@obbligato.org>
- Date
- Jan 11, 2016, 05:00 UTC
- Message-ID
- <1452488421-26823-6-git-send-email-greened@obbligato.org>
- In-Reply-To
- <1452488421-26823-1-git-send-email-greened@obbligato.org>
From: "David A. Greene" <greened@obbligato.org>
This tests rebase --preserve-merges in the presence of redundant commits when there are actual erges being rebased. It primarily exercises the --skip-redundant-commits option.
Signed-off-by: David A. Greene <greened@obbligato.org> --- t/t3429-rebase-redundant-merge.sh | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 t/t3429-rebase-redundant-merge.sh
diff --git a/t/t3429-rebase-redundant-merge.sh b/t/t3429-rebase-redundant-merge.sh new file mode 100755 index 0000000..f677bb1 --- /dev/null +++ b/t/t3429-rebase-redundant-merge.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +test_description='git rebase tests for redundant commits + +This test runs git rebase and tests handling of redundant commits. +' +. ./test-lib.sh +. "$TEST_DIRECTORY"/lib-rebase.sh + +# Setup this graph: +# +# O +# o-o-o-o-o R/rebaseOR/rebaseSR/rebasemergeOR/rebasemergeSR +# \ / +# o-o S +# +test_expect_success 'setup' ' + test_commit README && + git branch O && + git checkout -b branch O && + test_commit branch1 && + test_commit branch2 && + git branch S && + git checkout master && + test_commit master1 && + test_commit master2 && + git merge branch -m "Merge branch to master" && + test_commit merged1 && + git branch R && + git branch rebaseOR && + git branch rebaseSR && + git branch rebasemergeOR && + git branch rebasemergeskipOR && + git branch rebasemergeSR && + git branch rebasemergeskipSR +' + +test_expect_success 'rebase O..R --onto S' ' + reset_rebase && + git checkout rebaseOR && + git rebase O --onto S +' + +test_expect_success 'rebase S..R --onto S' ' + reset_rebase && + git checkout rebaseSR && + git rebase S --onto S +' + +test_expect_success 'rebase O..R --onto S preserving merges fails' ' + reset_rebase && + git checkout rebasemergeOR && + test_must_fail git rebase --preserve-merges O --onto S +' + +test_expect_success 'rebase O..R --onto S preserving merges --skip-redundant' ' + reset_rebase && + git checkout rebasemergeskipOR && + git rebase --skip-redundant-commits --preserve-merges O --onto S +' + +test_expect_success 'rebase S..R --onto S preserving merges' ' + reset_rebase && + git checkout rebasemergeSR && + git rebase --preserve-merges S --onto S +' + +test_expect_success 'rebase S..R --onto S preserving merges --skip-redundant' ' + reset_rebase && + git checkout rebasemergeskipSR && + git rebase --skip-redundant-commits --preserve-merges S --onto S +' +test_done
-- 2.6.1