5 # this is hardcoded; change it if needed
9 my $workdir = getcwd
();
11 # 'gitolite writable' command
12 # ----------------------------------------------------------------------
14 my $sf = ".gitolite.down";
17 try
"DEF POK = !/DENIED/; !/failed to push/";
19 # delete the down file
20 unlink "$ENV{HOME}/$sf";
22 # add foo, bar/..* repos to the config and push
33 try
"ADMIN_PUSH set1; !/FATAL/" or die text
();
36 # clone and push to foo
40 PUSH u1 master; ok; /new branch/
42 # auto-clone and push to bar/u2
44 CLONE u2 bar/u2; ok; /appear to have cloned an empty/
50 # disable site with some message
51 gitolite writable \@all off testing site-wide disable; ok
53 # try push foo and see fail + message
56 PUSH u1; !ok; /testing site-wide disable/
57 # try push bar/u2 and ...
60 PUSH u2; !ok; /testing site-wide disable/
62 # try auto-create push bar/u4 and this works!!
64 CLONE u4 bar/u4; ok; /appear to have cloned an empty/
66 !/testing site-wide disable/
70 gitolite writable \@all on; ok
74 # try push foo and see fail + message
77 PUSH u1; ok; /master -> master/
78 # try push bar/u2 and ...
81 PUSH u2; ok; /master -> master/
83 # try auto-create push bar/u4 and this works!!
85 CLONE u6 bar/u6; ok; /appear to have cloned an empty/
87 !/testing site-wide disable/
91 gitolite writable foo off foo down
93 # try push foo and see the message
96 PUSH u1; !ok; /foo down/
97 !/testing site-wide disable/
101 PUSH u2; ok; /master -> master/
103 # enable foo, disable bar/u2
104 gitolite writable foo on
105 gitolite writable bar/u2 off the bar is closed
110 PUSH u1; ok; /master -> master/
114 PUSH u2; !ok; /the bar is closed/
116 ssh u3 writable bar/u2 on; !ok; /you are not authorized/
117 ssh u3 writable \@all on; !ok; /you are not authorized/
119 ssh u2 writable bar/u2 on; ok
120 ssh u2 writable \@all on; !ok; /you are not authorized/
122 ssh admin writable \@all on;