chiark / gitweb /
Test suite: Change t-has-parent to t-has-parent-or-is
[dgit.git] / tests / tests / inarchivecopy
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-setup-import examplegit
6 t-tstunt-parsechangelog
7
8 cd $p
9 git checkout -b dgit/stable dgit/dgit/stable
10 cd ..
11
12 t-inarchive-copy () {
13         local vm=$1
14         local from=${2:-sid}
15         local to=${3:-stable}
16         egrep "^${vm//./\\.}" aq/package.$from.$p >>aq/package.$to.$p
17         t-archive-updated stable $p
18 }
19
20 copy-check-good () {
21         git diff $vtag
22         t-refs-same refs/remotes/dgit/dgit/stable
23         t-ref-head
24         t-has-parent-or-is HEAD $vtag
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-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.