aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaramc@gmail.com>2018-08-04 00:07:02 +0530
committerSitaram Chamarty <sitaramc@gmail.com>2018-08-04 06:24:17 +0530
commit295c217480c463b8292aca0d884ea35391241312 (patch)
treec56cd8ee2de0b9c537cb2be2f7d8c0a2ec229c6c
parentVREF/NAME needs special handling in expand-deny-messages (diff)
downloadgitolite-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-xsrc/commands/access3
-rwxr-xr-xt/access.t53
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;
}
diff --git a/t/access.t b/t/access.t
index c6c7b22..c3f3341 100755
--- a/t/access.t
+++ b/t/access.t
@@ -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
+";