5 # This test script tests each of the split brain quilt modes, and
6 # --quilt=linear, with a tree suitable for each of those, and pushes
7 # them in sequence. The idea is to check that each tree is rejected
8 # by the wrong quilt modes, and accepted and processed correctly by
11 t-tstunt-parsechangelog
15 # Easiest way to make a patches-unapplied but not-gbp tree is
16 # to take the patches-unapplied tree and by-hand commit the .gitignore
17 # changes as a debian patch.
27 t-dgit "$@" --quilt=$qmode build-source
29 t-dgit "$@" --quilt=$qmode push
34 echo "===== testing tree suitable for --quilt=gbp (only) ====="
36 t-expect-fail 'grep: new-upstream-file: No such file or directory' \
37 t-dgit --quilt=dpm build-source
39 t-expect-fail 'git tree differs from result of applying' \
40 t-dgit -wgf --quilt=dpm build-source
42 t-expect-fail 'git tree differs from orig in upstream files' \
43 t-dgit -wgf --quilt=unapplied build-source
45 t-expect-fail 'This might be a patches-unapplied branch' \
46 t-dgit -wgf build-source
48 # testing success with --quilt=gbp are done in quilt-gbp test case
51 echo "===== making tree suitable for --quilt=unapplied (only) ====="
53 pf=debian/patches/test-gitignore
56 From: Senatus <spqr@example.com>
57 Subject: Add .gitignore
62 git diff /dev/null .gitignore >>$pf || test $? = 1
63 echo ${pf##*/} >>debian/patches/series
65 git add debian/patches
67 git commit -m 'Turn gitignore into a debian patch'
68 gitigncommit=`git rev-parse HEAD`
70 t-commit unapplied 1.0-3
72 echo "----- testing tree suitable for --quilt=unapplied (only) -----"
74 t-expect-fail 'git tree differs from result of applying' \
75 t-dgit -wgf --quilt=dpm build-source
77 t-expect-fail 'gitignores: but, such patches exist' \
78 t-dgit -wgf --quilt=gbp build-source
80 t-expect-fail 'This might be a patches-unapplied branch' \
81 t-dgit -wgf build-source
83 want-success unapplied -wgf
86 echo "===== making fully-applied tree suitable for --quilt-check ====="
89 git merge --ff-only dgit/dgit/sid
91 t-commit vanilla 1.0-4
93 echo "----- testing fully-applied tree suitable for --quilt-check -----"
95 t-expect-fail 'gitignores: but, such patches exist' \
96 t-dgit --quilt=dpm build-source
98 t-expect-fail 'git tree differs from orig in upstream files' \
99 t-dgit --quilt=gbp build-source
101 t-expect-fail 'git tree differs from orig in upstream files' \
102 t-dgit --quilt=unapplied build-source
104 t-dgit --quilt=nofix build-source
107 t-dgit --quilt=nofix push
111 echo "===== making tree suitable for --quilt=dpm (only) ====="
114 git merge --ff-only dgit/dgit/sid
116 git revert --no-edit $gitigncommit
118 t-commit dpmish 1.0-5
120 echo "----- testing tree suitable for --quilt=dpm (only) -----"
122 t-expect-fail 'git tree differs from orig in upstream files' \
123 t-dgit -wgf --quilt=gbp build-source
125 t-expect-fail 'git tree differs from orig in upstream files' \
126 t-dgit -wgf --quilt=unapplied build-source
128 t-expect-fail 'This might be a patches-applied branch' \
129 t-dgit -wgf build-source