chiark / gitweb /
9dd2111baac87ff3db7f25c4649866f3e901d63c
[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.0
8
9 ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
10
11 cd $p
12
13 start () { git checkout quilt-tip~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 "cannot represent change: $wrongmsg: $wrongfn" \
25         attempt
26 }
27
28 badly-1 symlink 'not a plain file'
29         ln -s TARGET symlink
30         git add symlink
31 badly-2
32
33 start
34         git rm src.c
35         git commit -m deleted
36 attempt
37
38 badly-1 src.c 'mode changed'
39         chmod +x src.c
40         git add src.c
41 badly-2
42
43 badly-1 new 'non-default mode'
44         echo hi >new
45         chmod 755 new
46         git add new
47 badly-2
48
49 start
50 attempt
51
52 echo ok.