chiark / gitweb /
git-debrebase: capture breakwater tip
[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 good () {
16         attempt
17         t-dgit --quilt=nofix -wgf build-source
18         t-dgit -wgf --dry-run push --new
19 }
20
21 badly-1 () {
22         wrongfn=$1
23         wrongmsg=$2
24         start
25 }
26
27 badly-2 () {
28         git commit -m "Commit wrongness $wrongfn ($wrongmsg)"
29         t-expect-fail E:"cannot represent change: $wrongmsg .*: $wrongfn" \
30         attempt
31 }
32
33 badly-1 orig-symlink 'modified symlink'
34         ln -sf NEWTARGET orig-symlink
35         git add orig-symlink
36 badly-2
37
38 badly-1 orig-symlink 'deletion of symlink'
39         git rm -f orig-symlink
40 badly-2
41
42 start
43         git rm src.c
44         git commit -m deleted
45 good
46
47 start
48         git rm orig-exec
49         git rm -f orig-unwriteable
50         git commit -m 'deleted funny'
51 good
52
53 badly-1 src.c 'mode or type changed'
54         chmod +x src.c
55         git add src.c
56 badly-2
57
58 badly-1 new 'creation with non-default mode'
59         echo hi >new
60         chmod 755 new
61         git add new
62 badly-2
63
64 start
65 good
66
67 t-ok