chiark / gitweb /
b2de45289396b2108ff978d5cf8898ef231266f4
[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 'modified symlink'
29         ln -sf NEWTARGET orig-symlink
30         git add orig-symlink
31 badly-2
32
33 badly-1 orig-symlink 'deletion of symlink'
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 start
43         git rm orig-exec
44         git rm -f orig-unwriteable
45         git commit -m 'deleted funny'
46 attempt
47
48 badly-1 src.c 'mode or type changed'
49         chmod +x src.c
50         git add src.c
51 badly-2
52
53 badly-1 new 'creation with non-default mode'
54         echo hi >new
55         chmod 755 new
56         git add new
57 badly-2
58
59 start
60 attempt
61
62 t-ok