diff options
author | Sitaram Chamarty <sitaramc@gmail.com> | 2018-08-04 00:07:02 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaramc@gmail.com> | 2018-08-04 06:24:17 +0530 |
commit | 295c217480c463b8292aca0d884ea35391241312 (patch) | |
tree | c56cd8ee2de0b9c537cb2be2f7d8c0a2ec229c6c | |
parent | VREF/NAME needs special handling in expand-deny-messages (diff) | |
download | gitolite-gentoo-295c217480c463b8292aca0d884ea35391241312.tar.gz gitolite-gentoo-295c217480c463b8292aca0d884ea35391241312.tar.bz2 gitolite-gentoo-295c217480c463b8292aca0d884ea35391241312.zip |
fix 'C' and 'M' tests in 'gitolite access'...
C was being handled incorrectly, while M was not even considered (and
would behave as if MERGE_CHECK was set)
thanks to Björn Kautler
-rwxr-xr-x | src/commands/access | 3 | ||||
-rwxr-xr-x | t/access.t | 53 |
2 files changed, 54 insertions, 2 deletions
diff --git a/src/commands/access b/src/commands/access index f02e533..8e85966 100755 --- a/src/commands/access +++ b/src/commands/access @@ -85,8 +85,9 @@ while (<>) { sub adjust_aa { my ($repo, $aa) = @_; - $aa = '+' if $aa eq 'C' and not option($repo, 'CREATE_IS_C'); + $aa = 'W' if $aa eq 'C' and not option($repo, 'CREATE_IS_C'); $aa = '+' if $aa eq 'D' and not option($repo, 'DELETE_IS_D'); + $aa = 'W' if $aa eq 'M' and not option($repo, 'MERGE_CHECK'); return $aa; } @@ -9,7 +9,7 @@ use Gitolite::Test; # test 'gitolite access' # ---------------------------------------------------------------------- -try "plan 216"; +try "plan 254"; confreset;confadd ' @admins = admin dev1 @@ -200,3 +200,54 @@ try " gitolite access c1 u2 +; ok gitolite access c1 u2 C; !ok "; + +confreset;confadd ' + repo foo + R = u1 + RW = u2 + RW+ = u3 + + repo bar + R = u1 + RW = u2 + RW+ = u3 + RW+CDM = u6 + +'; + +try "ADMIN_PUSH set4; !/FATAL/" or die text(); + +try " + gitolite access foo u1 +; !ok + gitolite access foo u2 +; !ok + gitolite access foo u3 +; ok + gitolite access foo u1 C; !ok + gitolite access foo u2 C; ok + gitolite access foo u3 C; ok + gitolite access foo u1 D; !ok + gitolite access foo u2 D; !ok + gitolite access foo u3 D; ok + gitolite access foo u1 M; !ok + gitolite access foo u2 M; ok + gitolite access foo u3 M; ok + + gitolite access bar u1 +; !ok + gitolite access bar u2 +; !ok + gitolite access bar u3 +; ok + gitolite access bar u1 C; !ok + gitolite access bar u2 C; !ok + gitolite access bar u3 C; !ok + gitolite access bar u1 D; !ok + gitolite access bar u2 D; !ok + gitolite access bar u3 D; !ok + gitolite access bar u1 M; !ok + gitolite access bar u2 M; !ok + gitolite access bar u3 M; !ok + + gitolite access bar u6 R; ok + gitolite access bar u6 W; ok + gitolite access bar u6 +; ok + gitolite access bar u6 C; ok + gitolite access bar u6 D; ok + gitolite access bar u6 M; ok +"; |