summaryrefslogtreecommitdiff
path: root/tests/tests/unrepresentable
blob: 621829e1f0c64a5c39bc2b850be3374c695b426f (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
#!/bin/bash
set -e
. tests/lib

t-tstunt-parsechangelog

t-prep-newpackage example 1.1

ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .

cd $p

start () { git checkout quilt-tip-1.1~0; }
attempt () { t-dgit -wgf --quilt=smash quilt-fixup; }

badly-1 () {
	wrongfn=$1
	wrongmsg=$2
	start
}

badly-2 () {
	git commit -m "Commit wrongness $wrongfn ($wrongmsg)"
	t-expect-fail E:"cannot represent change: $wrongmsg .*: $wrongfn" \
	attempt
}

badly-1 symlink 'not a plain file'
	ln -s TARGET symlink
	git add symlink
badly-2

start
	git rm src.c
	git commit -m deleted
attempt

badly-1 src.c 'mode changed'
	chmod +x src.c
	git add src.c
badly-2

badly-1 new 'non-default mode'
	echo hi >new
	chmod 755 new
	git add new
badly-2

start
attempt

t-ok