# [PATCH 2/2] t6010: add test to git merge-base --all --octopus

1 messages from 2013-12-28 to 2013-12-28. Participants: Василий Макаров.
Thread: https://gitlist.dev/t/35582

## Василий Макаров, 2013-12-28 11:04

Subject: [PATCH 2/2] t6010: add test to git merge-base --all --octopus
Message-ID: <CABEtfDFRYkbVsJc2SZcCPwyUBAN=3dMv9yoYuoRce4c7VBxrkg@mail.gmail.com>
URL: https://gitlist.dev/e/CABEtfDFRYkbVsJc2SZcCPwyUBAN%3D3dMv9yoYuoRce4c7VBxrkg%40mail.gmail.com

```
And here is the test:

with git 1.8.5.2 this test don't pass because of git merge-base may
return duplicates and incorrect set of bases (not best common
ancestors)
---
 t/t6010-merge-base.sh | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
index f80bba8..8652c12 100755
--- a/t/t6010-merge-base.sh
+++ b/t/t6010-merge-base.sh
@@ -230,4 +230,43 @@ test_expect_success 'criss-cross merge-base for
octopus-step' '
  test_cmp expected.sorted actual.sorted
 '

+test_expect_success 'merge-base --octopus --all for complex tree' '
+ # Best common ancestor for JE, JAA and JDD is JC
+ #             JE
+ #            / |
+ #           /  |
+ #          /   |
+ #  JAA    /    |
+ #   |\   /     |
+ #   | \  | JDD |
+ #   |  \ |/ |  |
+ #   |   JC JD  |
+ #   |    | /|  |
+ #   |    |/ |  |
+ #  JA    |  |  |
+ #   |\  /|  |  |
+ #   | JB |  |  |
+ #   \  \ | /   /
+ #    \__\|/___/
+ #        J
+ test_commit J &&
+ test_commit JB &&
+ git reset --hard J &&
+ test_commit JC &&
+ git reset --hard J &&
+ test_commit JTEMP1 &&
+ test_merge JA JB &&
+ test_merge JAA JC &&
+ git reset --hard J &&
+ test_commit JTEMP2 &&
+ test_merge JD JB &&
+ test_merge JDD JC &&
+ git reset --hard J &&
+ test_commit JTEMP3 &&
+ test_merge JE JC &&
+ git rev-parse JC > expected &&
+ git merge-base --all --octopus JAA JDD JE > actual &&
+ test_cmp expected actual
+'
+
 test_done
-- 
1.8.3.1

```
