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