chiark / gitweb /
test suite: downstream-gitless: Add missing dependency on reprepro
[dgit.git] / tests / tests / downstream-gitless
1 #!/bin/bash
2 set -e
3 . tests/lib
4 . $troot/lib-reprepro
5
6 t-dependencies reprepro
7 t-setup-import examplegit
8 t-tstunt-parsechangelog
9
10
11 # rewrite some things, so we test the rewriting code
12
13 mkdir map
14 cd map
15 git init
16 cd ..
17
18 record-map () {
19         old=$(t-git-get-ref-exact "refs/original/$r")
20         new=$(t-git-get-ref-exact "$r")
21         if [ "$old" = "$new" ]; then return; fi
22         echo >>$tmp/map/map "$old $new"
23 }
24
25 filter () {
26         git filter-branch                               \
27                 --msg-filter 'sed s/Sid/Spong/'         \
28                 --tag-name-filter cat                   \
29                 ^archive/test-dummy/2.0                 \
30                 "$@"
31         for r in "$@"; do
32                 record-map "$r"
33         done
34 }
35
36 cd $p
37 filter                          \
38   refs/heads/master             \
39   refs/remotes/dgit/dgit/sid
40
41 t-ref-head
42
43 cd ../git/$p.git
44 filter                          \
45   refs/dgit/sid
46
47 cd $tmp/map
48 git add map
49 git commit -m 'by test suite'
50 git push $tmp/git/$p.git master:refs/dgit-rewrite/map
51 cd ..
52
53
54 suitespecs=avon
55 t-reprepro-cfg ds- downstream
56 t-reprepro-setup ds-
57 distro=''
58
59
60 dscf=$tmp/mirror/pool/main/example_1.1.dsc
61 t-reprepro-includedsc avon $dscf ds-
62 t-reprepro-regen ds-
63
64
65 mkdir $p.import
66 cd $p.import
67 git init
68 t-dgit import-dsc $dscf x
69 cd ..
70
71 t-git-config dgit-suite.avon.distro downstream
72 t-git-config dgit-distro.downstream.git-check false
73
74 t-dgit clone example avon example.avon
75
76
77 dscf=$tmp/mirror/pool/main/example_2.1.dsc
78 t-reprepro-includedsc avon $dscf ds-
79 t-reprepro-regen ds-
80
81
82 cd $p.avon
83 t-dgit fetch
84 t-ref-same refs/remotes/dgit/dgit/avon
85
86 cd ../$p.import
87 git init
88 t-dgit import-dsc $dscf +x
89 t-ref-same refs/heads/x
90 git show x | grep Spong
91
92 t-expect-fail 'Your git tree does not have that object' \
93 t-dgit --no-chase-dsc-distro import-dsc $dscf +y
94
95 cd ../$p
96 t-dgit --no-chase-dsc-distro import-dsc $dscf +y
97 git show y | grep Sid
98
99 t-ok