eliminate race (loaded systems only?) that makes gl-conf look empty
[gitolite.git] / t / merge-check.t
blobfdea318fa6ba5d535bdf764510a8d77588b3fed6
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 # this is hardcoded; change it if needed
6 use lib "src/lib";
7 use Gitolite::Test;
9 # merge check -- the M flag
10 # ----------------------------------------------------------------------
12 try "plan 55";
14 confreset;confadd '
15 repo foo
16 RW+M = u1
17 RW+ = u2
18 RWM .= u3
19 RW = u4
22 try "ADMIN_PUSH set1; !/FATAL/" or die text();
24 # setup a merged push
26 try "
27 cd ..
28 [ -d foo ]; !ok
29 glt clone u1 file:///foo
30 ok; /Cloning into/
31 /You appear to have cloned an empty/
34 try "
35 cd foo; ok
36 [ -d .git ]; ok
37 test-commit aa; ok; /1 file changed, 1 insertion/
38 tag start; ok
39 glt push u1 origin master
40 ok; /new branch.*master.-..master/
41 /create.delete ignored.*merge-check/
42 checkout -b new; ok; /Switched to a new branch 'new'/
43 test-commit bb cc; ok
44 checkout master; ok; /Switched to branch 'master'/
45 test-commit dd ee; ok
46 git merge new; ok; /Merge made.*recursive/
47 test-commit ff; ok
48 tag end; ok
51 # push by u4 should fail
52 try "
53 glt push u4 file:///foo master
54 !ok; /WM refs/heads/master foo u4 DENIED by fallthru/
55 /To file:///foo/
56 /remote rejected.*hook declined/
57 /failed to push some refs/
60 # push by u3 should succeed
61 try "
62 glt push u3 file:///foo master
63 ok; /To file:///foo/; /master.-..master/
66 # rewind by u3 should fail
67 try "
68 reset-h start; ok; /HEAD is now at .* aa /
69 glt push u3 file:///foo +master
70 !ok; /rejected.*hook declined/
71 /failed to push some refs/
74 # rewind by u2 should succeed
75 try "
76 glt push u2 file:///foo +master
77 ok; /To file:///foo/
78 /forced update/
81 # push by u2 should fail
82 try "
83 reset-h end; ok; /HEAD is now at .* ff /
84 glt push u2 file:///foo master
85 !ok; /WM refs/heads/master foo u2 DENIED by fallthru/
86 /To file:///foo/
87 /remote rejected.*hook declined/
88 /failed to push some refs/
91 # push by u1 should succeed
92 try "
93 glt push u1 file:///foo master
94 ok; /master.-..master/