chiark / gitweb /
fa71bd38b6e4ca7492ea2eb8eb4832d1c4c2109b
[dgit.git] / tests / tests / unrepresentable
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt-parsechangelog
6
7 t-prep-newpackage example 1.1
8
9 ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
10
11 cd $p
12
13 start () { git checkout quilt-tip-1.1~0; }
14 attempt () { t-dgit -wgf --quilt=smash quilt-fixup; }
15
16 badly-1 () {
17         wrongfn=$1
18         wrongmsg=$2
19         start
20 }
21
22 badly-2 () {
23         git commit -m "Commit wrongness $wrongfn ($wrongmsg)"
24         t-expect-fail E:"cannot represent change: $wrongmsg .*: $wrongfn" \
25         attempt
26 }
27
28 badly-1 orig-symlink 'not a plain file'
29         ln -sf NEWTARGET orig-symlink
30         git add orig-symlink
31 badly-2
32
33 badly-1 orig-symlink 'not a plain file'
34         git rm -f orig-symlink
35 badly-2
36
37 start
38         git rm src.c
39         git commit -m deleted
40 attempt
41
42 badly-1 src.c 'mode changed'
43         chmod +x src.c
44         git add src.c
45 badly-2
46
47 badly-1 new 'non-default mode'
48         echo hi >new
49         chmod 755 new
50         git add new
51 badly-2
52
53 start
54 attempt
55
56 t-ok