summaryrefslogtreecommitdiff
path: root/tests/tests/dpkgsourceignores-correct
blob: 33de95e83633f24a3651e23a91d1cf1869417c3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
set -e
. tests/lib

t-tstunt-parsechangelog

t-archive example 1.0-1
t-git-none

t-dgit --no-rm-on-error clone $p

cd $p

bad-dpkg-source () {
	t-expect-fail E:"dpkg-source:.*unexpected upstream changes" \
	t-dgit --quilt=nofix -wgf build-source
	find * -name .git -print0 | xargs -0r rm --
}

ignores=$(t-dgit print-dpkg-source-ignores)

spurious-git-must-be-excluded () {
	dpkg-source $ignores -b .
	mkdir check
	cd check
	dpkg-source -x ../../${p}_${v}.dsc
	cd ${p}-${v%-*}
	find -name .git >../bad
	diff /dev/null ../bad
	cd ../..
	find * -name .git -print0 | xargs -0r rm -rf --
	git clean -xdff
}

mkdir docs/.git
echo hi >docs/.git/ho
spurious-git-must-be-excluded

echo hi >docs/.git
spurious-git-must-be-excluded

mkdir not-really.git
echo fee >not-really.git/something
echo fi >not-really.gitfoo
echo fo >some.git
echo fum >some.gitfoo
git add .
git commit -m 'want these'

t-dgit --quilt=smash -wgf build-source
t-dgit -wgf push

t-ok