summaryrefslogtreecommitdiffstats
path: root/t/rule-seq.t
blob: 0d9755851014ab7e9521de1eae291d9aeb3bc8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/perl
use strict;
use warnings;

# this is hardcoded; change it if needed
use lib "src/lib";
use Gitolite::Test;

# rule sequence
# ----------------------------------------------------------------------

# this is the specific example in commit 32056e0 of g2

try "plan 27";

try "DEF POK = !/DENIED/; !/failed to push/";

confreset; confadd '
    @private-owners = u1 u2
    @experienced-private-owners = u3 u4

    repo CREATOR/.*
      C   = @private-owners @experienced-private-owners
      RWD = CREATOR
      RW  = WRITERS
      R   = READERS
      -   = @private-owners
      RW+D = CREATOR
';

try "ADMIN_PUSH set1; !/FATAL/" or die text();

try "
    cd ..
    glt clone u1 file:///u1/r1
        /Initialized empty Git repository in .*/u1/r1.git//
    cd r1
    tc h-395
    glt push u1 origin master
    git checkout -b br1
    tc m-367
    tc i-747

    # u1 create branch
    glt push u1 origin br1
        /\\* \\[new branch\\]      br1 -> br1/
        POK; /br1 -> br1/

    # u1 rewind branch
    git reset --hard HEAD^
    tc e-633
    glt push u1 origin +br1
        /\\+ refs/heads/br1 u1/r1 u1 DENIED by refs//
        /error: hook declined to update refs/heads/br1/
        reject

    # u1 delete branch
    glt push u1 origin :br1
        /\\[deleted\\]         br1/

    cd ..
    rm -rf r1
    glt clone u3 file:///u3/r1
        /Initialized empty Git repository in .*/u3/r1.git//
    cd r1
    tc p-274
    glt push u3 origin master
    git checkout -b br1
    tc s-613
    tc k-988

    # u3 create branch
    glt push u3 origin br1
        /\\* \\[new branch\\]      br1 -> br1/
        POK; /br1 -> br1/

    # u3 rewind branch
    git reset --hard HEAD^
    tc n-919
    glt push u3 origin +br1
        /To file:///u3/r1/
        /\\+ .......\\.\\.\\........ br1 -> br1 \\(forced update\\)/

    # u3 delete branch
    glt push u3 origin :br1
        /\\[deleted\\]         br1/
";