7 local gdr=${DGIT_GITDEBREBASE_TEST-git-debrebase}
9 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
10 $gdr $GDR_TEST_OPTS $GDR_TEST_DEBUG $t_gdr_xopts "$@"
11 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
15 t-gdr-branch-structure () {
17 # state should be one of
25 laundered) etype=Upstream ;;
26 stitched) etype=Pseudomerge ;;
27 pushed) etype=AddPatches; netype=Pseudomerge ;;
30 t-git-debrebase analyse >../anal.check
31 expect=`git rev-parse HEAD`
33 local cid ctype info nparents
34 while read cid ctype info; do
35 : ===== $cid $ctype $info =====
38 if [ "x$ctype" = "x$etype" ]; then cetype=SAME; fi
39 local parents="`git log -n1 --pretty=format:%P $cid`"
42 : "$ctype/$cetype" "$parents"
43 case "$ctype/$cetype" in
45 expect=${info#Contributor=}
48 git diff --quiet $expect..$cid
53 git diff --quiet $expect..$cid -- ':.' ':!debian'
54 git diff --quiet $expect..$cid -- ':debian/patches'
58 git diff --quiet $expect..$cid -- \
59 ':.' ':!debian/patches'
65 git diff --quiet $expect..$cid -- \
66 ':.' ':!debian/changelog'
70 git diff --quiet $expect..$cid -- ':debian'
72 BreakwaterUpstreamMerge/Upstream| \
73 BreakwaterUpstreamMerge/Packaging)
77 fail "etype=$etype ctype=$ctype cetype=$cetype $cid"
81 local cnparents=`printf "%s" "$parents" | wc -w`
82 test $cnparents = $enparents
86 *) fail 'unexpected parent' ;;
95 echo >>debian/zorkmid "// debian $token"
96 git add debian/zorkmid
97 git commit -m "DEBIAN add zorkmid ($token)"
99 echo >>src.c "// upstream $token"
100 git commit -a -m "UPSTREAM edit src.c ($token)"
102 for f in debian/zorkmid src.c; do
103 echo "// both! $token" >>$f
106 git commit -m "MIXED add both ($token)"