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