summaryrefslogtreecommitdiff
path: root/t/t3430-rebase-merges.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-05-04 01:01:29 +0200
committerJunio C Hamano <gitster@pobox.com>2018-05-06 13:21:58 +0900
commit8fa6eea0ffd271f0564048dc939987e9640efca5 (patch)
tree0af599a25e6680e388b0bc623e14c184c91ea99a /t/t3430-rebase-merges.sh
parent9c85a1c29c5ac26c94aa6eda8da9bbfbc6751785 (diff)
downloadgit-8fa6eea0ffd271f0564048dc939987e9640efca5.tar.gz
rebase --rebase-merges: root commits can be cousins, too
Reported by Wink Saville: when rebasing with no-rebase-cousins, we will want to refrain from rebasing all of them, even when they are root commits. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3430-rebase-merges.sh')
-rwxr-xr-xt/t3430-rebase-merges.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 5543f1d5a3..ce6de6f491 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -287,5 +287,30 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' '
test_cmp_rev HEAD $head
'
+test_expect_success 'A root commit can be a cousin, treat it that way' '
+ git checkout --orphan khnum &&
+ test_commit yama &&
+ git checkout -b asherah master &&
+ test_commit shamkat &&
+ git merge --allow-unrelated-histories khnum &&
+ test_tick &&
+ git rebase -f -r HEAD^ &&
+ ! test_cmp_rev HEAD^2 khnum &&
+ test_cmp_graph HEAD^.. <<-\EOF &&
+ * Merge branch '\''khnum'\'' into asherah
+ |\
+ | * yama
+ o shamkat
+ EOF
+ test_tick &&
+ git rebase --rebase-merges=rebase-cousins HEAD^ &&
+ test_cmp_graph HEAD^.. <<-\EOF
+ * Merge branch '\''khnum'\'' into asherah
+ |\
+ | * yama
+ |/
+ o shamkat
+ EOF
+'
test_done