chiark / gitweb /
41c0321e3c0205820e72050be5125fa04f969735
[dgit.git] / tests / tests / inarchivecopy
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-setup-import examplegit
6
7 cd $p
8 git checkout -b dgit/stable dgit/dgit/stable
9 cd ..
10
11 t-inarchive-copy () {
12         local vm=$1
13         local from=${2:-sid}
14         local to=${3:-stable}
15         egrep "^${vm//./\\.}" aq/package.$from.$p >>aq/package.$to.$p
16         t-archive-updated stable $p
17 }
18
19 copy-check-good () {
20         git diff $vtag
21         t-refs-same refs/remotes/dgit/dgit/stable
22         t-ref-head
23 }
24
25 copy-check () {
26         local vm=$1
27         t-inarchive-copy $vm
28
29         vtag=$(v=$vm t-v-tag)
30
31         cd $p
32          t-refs-same-start
33          t-ref-same $vtag^1
34
35          t-dgit fetch stable
36          git merge --ff-only dgit/dgit/stable
37
38          copy-check-good
39          local fetched=$(t-sametree-parent HEAD)
40         cd ..
41
42         rm -rf example.cloned
43         t-dgit clone $p stable example.cloned
44
45         cd example.cloned
46          t-refs-same-start
47          copy-check-good
48          local cloned=$(t-sametree-parent HEAD)  
49         cd ..
50
51         t-refs-same-start
52         t-ref-same-val fetched $fetched
53         t-ref-same-val cloned $cloned
54 }
55
56 copy-check 2.0
57
58 copy-check 2.1
59
60 echo ok.