chiark / gitweb /
test suite: dpkgsourceignores-correct: Test that the rune DTRT
[dgit.git] / tests / tests / dpkgsourceignores-correct
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt-parsechangelog
6
7 t-archive example 1.0-1
8 t-git-none
9
10 t-dgit --no-rm-on-error clone $p
11
12 cd $p
13
14 bad-dpkg-source () {
15         t-expect-fail E:"dpkg-source:.*unexpected upstream changes" \
16         t-dgit --quilt=nofix -wgf build-source
17         find * -name .git -print0 | xargs -0r rm --
18 }
19
20 ignores=$(t-dgit print-dpkg-source-ignores)
21
22 spurious-git-must-be-excluded () {
23         dpkg-source $ignores -b .
24         mkdir check
25         cd check
26         dpkg-source -x ../../${p}_${v}.dsc
27         cd ${p}-${v%-*}
28         find -name .git >../bad
29         diff /dev/null ../bad
30         cd ../..
31         find * -name .git -print0 | xargs -0r rm -rf --
32         git clean -xdff
33 }
34
35 mkdir docs/.git
36 echo hi >docs/.git/ho
37 spurious-git-must-be-excluded
38
39 echo hi >docs/.git
40 spurious-git-must-be-excluded
41
42 mkdir not-really.git
43 echo fee >not-really.git/something
44 echo fi >not-really.gitfoo
45 echo fo >some.git
46 echo fum >some.gitfoo
47 git add .
48 git commit -m 'want these'
49
50 t-dgit --quilt=smash -wgf build-source
51 t-dgit -wgf push
52
53 t-ok