summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-30 15:11:28 -0800
committerJunio C Hamano <gitster@pobox.com>2013-12-30 15:12:38 -0800
commitd84a3da003f8380f61d9c80b216a94af3fab8deb (patch)
tree29a97071b36d7794100a6987849ea136735758d6
parente0f9cc5854ad99db7ed1e276f2fe81ccfd7ce869 (diff)
downloadgit-jc/graph-post-root-gap.tar.gz
WIP: document what we want at the endjc/graph-post-root-gap
-rwxr-xr-xt/t6016-rev-list-graph-simplify-history.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh
index f7181d1d6a..98d5733b9e 100755
--- a/t/t6016-rev-list-graph-simplify-history.sh
+++ b/t/t6016-rev-list-graph-simplify-history.sh
@@ -264,4 +264,59 @@ test_expect_success '--graph --boundary ^C3' '
test_cmp expected actual
'
+one_independent_branch () {
+ git checkout --orphan root$1 A1 &&
+ test_commit root_$1 &&
+ test_commit then_$1 &&
+ test_commit further_$1
+}
+
+test_expect_success 'multi-root setup' '
+ one_independent_branch 0 &&
+ one_independent_branch 1 &&
+ one_independent_branch 2 &&
+
+ git checkout -b merge210 root2 &&
+ test_tick &&
+ git merge -s ours root1 &&
+ test_tick &&
+ git merge -s ours root0
+'
+
+test_expect_success 'multi-root does not emit unnecessary post-root gap' '
+ sed -e "s/ #$/ /" >expect <<-\EOF &&
+ * Merge branch '\''root0'\'' into merge210
+ |\ #
+ | * further_0
+ | * then_0
+ | * root_0
+ * Merge branch '\''root1'\'' into merge210
+ |\ #
+ | * further_1
+ | * then_1
+ | * root_1
+ * further_2
+ * then_2
+ * root_2
+ EOF
+ git log --graph --format=%s >actual &&
+ test_cmp expect actual
+'
+
+test_expect_failure 'multi-root does show necessary post-root gap' '
+ sed -e "s/ #$/ /" >expect <<-\EOF &&
+ * further_2
+ * then_2
+ * root_2
+ * further_1
+ * then_1
+ * root_1
+ * further_0
+ * then_0
+ * root_0
+ EOF
+ git log --graph --format=%s root0 root1 root2 >actual &&
+ test_cmp expect actual
+'
+
test_done