chiark / gitweb /
dgit: aptget archive access method
[dgit.git] / tests / tests / drs-push-masterupdate
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-drs
6 t-tstunt-parsechangelog
7
8 t-prep-newpackage example 1.0
9
10 cd $p
11
12 git tag common-ancestor
13
14 revision=1
15 t-dgit build
16 t-dgit push --new
17
18 push_and_check () {
19         git push $dgitrepo $1
20
21         oldmaster=`cd $dgitrepo && t-git-get-ref refs/heads/master`
22
23         t-refs-same-start
24         git checkout master
25         t-commit 'Empty update'
26         t-dgit build
27         t-dgit push --new
28
29         t-pushed-good master
30 }
31
32 t-check-master-undisturbed () {
33         local master=`t-git-get-ref refs/heads/master`
34         if [ x$master != x$oldmaster ]; then fail "bad update to master"; fi
35 }
36
37 t_check_pushed_master=t-check-master-undisturbed
38
39 git checkout -b divergent common-ancestor
40 git commit --allow-empty -m 'Has common ancestor'
41 git push $dgitrepo HEAD:master
42
43 push_and_check HEAD:master
44
45 git checkout --orphan newroot
46 git commit --allow-empty -m 'Has no common ancestor'
47
48 push_and_check +HEAD:master
49
50 echo done.