]>
Commit | Line | Data |
---|---|---|
5948e2ae MV |
1 | #!/bin/sh |
2 | ||
47a528ad | 3 | test_description='git merge |
5948e2ae MV |
4 | |
5 | Testing octopus merge with more than 25 refs.' | |
6 | ||
7 | . ./test-lib.sh | |
8 | ||
9 | test_expect_success 'setup' ' | |
10 | echo c0 > c0.c && | |
11 | git add c0.c && | |
12 | git commit -m c0 && | |
13 | git tag c0 && | |
14 | i=1 && | |
15 | while test $i -le 30 | |
16 | do | |
17 | git reset --hard c0 && | |
18 | echo c$i > c$i.c && | |
19 | git add c$i.c && | |
20 | git commit -m c$i && | |
21 | git tag c$i && | |
cf60c8f3 | 22 | i=$(expr $i + 1) || return 1 |
5948e2ae MV |
23 | done |
24 | ' | |
25 | ||
1c7b76be | 26 | test_expect_success 'merge c1 with c2, c3, c4, ... c29' ' |
5948e2ae MV |
27 | git reset --hard c1 && |
28 | i=2 && | |
29 | refs="" && | |
30 | while test $i -le 30 | |
31 | do | |
32 | refs="$refs c$i" | |
cf60c8f3 | 33 | i=$(expr $i + 1) |
a48fcd83 | 34 | done && |
5948e2ae MV |
35 | git merge $refs && |
36 | test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" && | |
37 | i=1 && | |
38 | while test $i -le 30 | |
39 | do | |
40 | test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" && | |
cf60c8f3 | 41 | i=$(expr $i + 1) || return 1 |
5948e2ae MV |
42 | done && |
43 | git diff --exit-code && | |
44 | i=1 && | |
45 | while test $i -le 30 | |
46 | do | |
47 | test -f c$i.c && | |
cf60c8f3 | 48 | i=$(expr $i + 1) || return 1 |
5948e2ae MV |
49 | done |
50 | ' | |
51 | ||
81334502 SB |
52 | cat >expected <<\EOF |
53 | Trying simple merge with c2 | |
54 | Trying simple merge with c3 | |
55 | Trying simple merge with c4 | |
f23101bf | 56 | Merge made by the 'octopus' strategy. |
dc801e71 ZJS |
57 | c2.c | 1 + |
58 | c3.c | 1 + | |
59 | c4.c | 1 + | |
7f814632 | 60 | 3 files changed, 3 insertions(+) |
81334502 SB |
61 | create mode 100644 c2.c |
62 | create mode 100644 c3.c | |
63 | create mode 100644 c4.c | |
64 | EOF | |
65 | ||
66 | test_expect_success 'merge output uses pretty names' ' | |
67 | git reset --hard c1 && | |
68 | git merge c2 c3 c4 >actual && | |
fc5877a6 | 69 | test_i18ncmp expected actual |
81334502 SB |
70 | ' |
71 | ||
72 | cat >expected <<\EOF | |
833abdc9 | 73 | Merge made by the 'recursive' strategy. |
dc801e71 | 74 | c5.c | 1 + |
7f814632 | 75 | 1 file changed, 1 insertion(+) |
81334502 SB |
76 | create mode 100644 c5.c |
77 | EOF | |
78 | ||
e78cbf8c | 79 | test_expect_success 'merge reduces irrelevant remote heads' ' |
c8c35f6a EN |
80 | if test "$GIT_TEST_MERGE_ALGORITHM" = ort |
81 | then | |
82 | mv expected expected.tmp && | |
83 | sed s/recursive/ort/ expected.tmp >expected && | |
84 | rm expected.tmp | |
85 | fi && | |
833abdc9 | 86 | GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual && |
fc5877a6 | 87 | test_i18ncmp expected actual |
81334502 | 88 | ' |
85bf49f9 SB |
89 | |
90 | cat >expected <<\EOF | |
91 | Fast-forwarding to: c1 | |
92 | Trying simple merge with c2 | |
f23101bf | 93 | Merge made by the 'octopus' strategy. |
dc801e71 ZJS |
94 | c1.c | 1 + |
95 | c2.c | 1 + | |
7f814632 | 96 | 2 files changed, 2 insertions(+) |
85bf49f9 SB |
97 | create mode 100644 c1.c |
98 | create mode 100644 c2.c | |
99 | EOF | |
100 | ||
101 | test_expect_success 'merge fast-forward output uses pretty names' ' | |
102 | git reset --hard c0 && | |
103 | git merge c1 c2 >actual && | |
fc5877a6 | 104 | test_i18ncmp expected actual |
85bf49f9 SB |
105 | ' |
106 | ||
5948e2ae | 107 | test_done |