chiark / gitweb /
git-debrebase: breakwater_of: permit unclean to be an fproblem
[dgit.git] / tests / tests / protocol-compat
1 #!/bin/bash
2 set -e
3 . tests/lib
4 . $troot/lib-reprepro
5
6 t-setup-import examplegit
7 t-tstunt-parsechangelog
8
9 t-git-config dgit.default.distro foreign
10 t-git-config dgit-distro.foreign.cmd-git false
11
12 prep () {
13         dscf=$tmp/mirror/pool/main/example_$v.dsc
14 }
15
16 check () {
17         pd=$p.$suite
18         t-refs-same-start
19
20         t-archive-none $p
21         t-archive-query $suite
22
23         t-dgit clone $p $suite $pd
24         cd $pd
25         t-ref-head
26
27         $1
28
29         local distro=''
30         t-dgit import-dsc $dscf +imported
31         t-ref-same refs/heads/imported
32         cd ..
33 }
34
35 reset () {
36         cd ..
37         rm -rf $pd
38         mkdir $pd
39         cd $pd
40         git init
41 }
42
43 : ---------- newer ----------
44
45 suite=sid
46 v=2.1
47 prep
48
49 perl -i~ -pe 's/^Dgit: .*/$& EXTRA DATA\n TO BE IGNORED/' $dscf
50
51 check reset
52
53 : ---------- newline ----------
54
55 suite=testing
56 v=2.0
57 prep
58
59 perl -i~ -pe 's/^(Dgit: \w+ \S+ \S+) (.*)/$1\n $2 EXTRA/' $dscf
60
61 check reset
62
63 : ---------- older ----------
64
65 suite=stable
66 v=1.2
67 prep
68
69 perl -i -pe 's/^(Dgit: \w+).*/$1/' $dscf
70
71 check
72
73 : ---------- expect fail ----------
74
75 pd=$p.fail
76
77 t-git-config dgit.default.old-dsc-distro downstream
78
79 t-expect-fail 'no configured url and .dsc provides no hint' \
80 t-dgit clone $p $suite $pd
81
82
83 t-ok