3 test_description
='tg update can create an octopus merge'
11 uctmp
="$(test_get_temp update-check)" || die
13 branch_is_up_to_date
() {
14 needs_update_check
"$@" >"$uctmp" &&
16 read -r uc_processed
&&
21 test z
"$uc_behind" = z
":"
24 test_expect_success
'setup' '
25 test_create_repo pristine &&
27 git checkout --orphan release &&
28 git read-tree --empty &&
30 test_commit "release~1" &&
31 tg_test_create_branches <<-EOT &&
32 t/patch1 [PATCH] alpha patch
35 t/patch2 [PATCH] beta patch
38 t/patch3 [PATCH] gamma patch
41 git checkout -f t/patch1 &&
42 test_commit "alpha~1" &&
43 git checkout -f t/patch2 &&
44 test_commit "beta~1" &&
45 git checkout -f t/patch3 &&
46 test_commit "gamma~1" &&
47 tg_test_create_branch t/int -m "[INTERMEDIATE] extra level" t/patch2 &&
48 tg_test_create_branch stage -m "[STAGE] staging branch" release t/patch1 t/int t/patch3 &&
49 test_must_fail branch_is_up_to_date stage &&
50 git gc --aggressive --prune=now &&
52 cp -pR pristine octopus
57 test_expect_success
'tg update to make octopus' '
61 test_expect_success
'verify 4-way octopus created' '
62 tmp1="$(test_get_temp cmt)" &&
63 tmp2="$(test_get_temp hdr)" &&
64 tmp3="$(test_get_temp pnt)" &&
65 git cat-file commit "$(tg --top-bases)/stage" >"$tmp1" &&
66 sed -n "1,/^\$/p" <"$tmp1" >"$tmp2" &&
67 sed -n "/^parent /p" <"$tmp2" >"$tmp3" &&
68 lines="$(wc -l <"$tmp3")" &&
72 test_expect_success
'verify all files present' '
73 git diff --exit-code release:release~1.t stage:release~1.t &&
74 git diff --exit-code t/patch1:alpha~1.t stage:alpha~1.t &&
75 git diff --exit-code t/patch2:beta~1.t stage:beta~1.t &&
76 git diff --exit-code t/patch3:gamma~1.t stage:gamma~1.t