3 test_description
='test TopGit DAG exports (all 3 types)'
13 test_expect_success
'setup' '
14 test_create_repo thedag && cd thedag &&
15 git config remote.yeehaw.url "." &&
16 git config topgit.remote yeehaw &&
17 git checkout --orphan lonesome &&
18 git read-tree --empty &&
20 git commit --allow-empty -m "lonesome empty place" &&
22 tg_test_create_branches <<-EOT &&
23 ::release [RELEASE] build upon this
26 +release some release commit
29 ::first [PATCH] first level patch
32 +first commit on first
35 ::second [PATCH] second first level patch
38 +second commit on second
41 ::third [PATCH] third second level patch
44 +third commit on third
47 ::fourth [PATCH] fourth first level patch
50 +fourth commit on fourth
53 ::stage [STAGE] staging branch here
59 git symbolic-ref HEAD "$(tg --top-bases)/stage" &&
61 git rm --force --ignore-unmatch -- .topmsg .topdeps &&
62 git read-tree -m HEAD first &&
63 git rm --force --ignore-unmatch -- .topmsg .topdeps &&
64 git read-tree -m HEAD third &&
65 git rm --force --ignore-unmatch -- .topmsg .topdeps &&
66 git read-tree -m HEAD fourth &&
67 git rm --force --ignore-unmatch -- .topmsg .topdeps &&
68 newtree="$(git write-tree)" && test -n "$newtree" &&
70 newcommit="$(git commit-tree -p HEAD -p first -p third -p fourth -m "mighty octopus" "$newtree")" &&
71 test -n "$newcommit" && git update-ref HEAD "$newcommit" HEAD &&
72 git checkout -f stage &&
74 git merge -m "bases up" "$(tg --top-bases)/stage"
77 baretree
="$(tg_test_bare_tree -C thedag stage)" || die
"missing bare stage tree"
79 test_expect_success
'export --collapse' '
81 git checkout -f stage &&
82 tg export --collapse collapse &&
83 test_cmp_rev $baretree collapse^{tree}
86 test_expect_success
'export --linearize' '
88 git checkout -f stage &&
89 tg export --linearize linearize &&
90 test_cmp_rev $baretree linearize^{tree}
93 test_expect_success
'export --quilt' '
94 git -C thedag checkout -f stage &&
95 tg -C thedag export --quilt --strip --numbered "$PWD/quilt"
98 test_expect_success
'import quilt patches' '
100 git checkout -f -b quilt lonesome &&
101 git am ../quilt/000*.diff &&
102 test_cmp_rev $baretree quilt^{tree}