chiark / gitweb /
test suite: downtream-gitless: Add some rewriting
[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 cd ../git/$p.git
41 filter                          \
42   refs/dgit/sid
43
44 cd $tmp/map
45 git add map
46 git commit -m 'by test suite'
47 git push $tmp/git/$p.git master:refs/dgit-rewrite/map
48 cd ..
49
50
51 suitespecs=avon
52 t-reprepro-cfg ds- downstream
53 t-reprepro-setup ds-
54
55 t-reprepro-includedsc avon $tmp/mirror/pool/main/example_1.1.dsc ds-
56
57 t-reprepro-regen ds-
58
59 distro=''
60
61 t-git-config dgit-suite.avon.distro downstream
62 t-git-config dgit-distro.downstream.git-check false
63
64 t-dgit clone example avon example.avon
65
66 t-reprepro-includedsc avon $tmp/mirror/pool/main/example_2.1.dsc ds-
67
68 cd $p.avon
69 t-dgit fetch
70
71 #t-ok