summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/GitACL.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/GitACL.pm b/lib/GitACL.pm
index 4c1cc67..2bb78e5 100644
--- a/lib/GitACL.pm
+++ b/lib/GitACL.pm
@@ -158,7 +158,7 @@ sub match_ref($$) {
my ($self, $expr) = @_;
return ($self->{ref} =~ /$expr/) if ($expr =~ /^\^/);
- return ("$self->{ref}/" eq $expr or index($self->{ref}, $expr) == 0)
+ return ("$self->{ref}/" eq $expr || index($self->{ref}, $expr) == 0)
if ($expr =~ /\/$/);
return $self->{ref} eq $expr;
}
@@ -180,10 +180,10 @@ sub match_tree($$) {
for (my $i = 0; $i <= $#{$self->{tree}}; ) {
my $dir = $self->{tree}[$i];
- if (($expr =~ /^\^/ and $dir =~ /$expr/)
- or ($expr =~ /\/$/
- and ("$dir/" eq $expr or index($dir, $expr) == 0))
- or $dir eq $expr) {
+ if (($expr =~ /^\^/ && $dir =~ /$expr/)
+ || ($expr =~ /\/$/
+ && ("$dir/" eq $expr or index($dir, $expr) == 0))
+ || $dir eq $expr) {
splice(@{$self->{tree}}, $i, 1);
} else {
++$i;
@@ -202,7 +202,7 @@ sub match_tuple($$) {
unless ($x[0] eq 'allow' || $x[0] eq 'deny');
return ( 0, "project mismatch" )
- if ($x[1] ne "all" and $x[1] ne $self->{project_name});
+ if ($x[1] ne "all" && $x[1] ne $self->{project_name});
return ( 0, "user mismatch" )
unless $self->match_user($x[2]);
return ( 0, "op mismatch" )
@@ -270,12 +270,12 @@ sub new {
}
$obj->deny("no such user") unless $obj->{user_name};
my $httpdusr = git_value('config', 'hooks.acl.httpd-user');
- if (defined($httpdusr) and $obj->{user_name} eq $httpdusr) {
+ if (defined($httpdusr) && $obj->{user_name} eq $httpdusr) {
$obj->deny("need authenticated user") unless $ENV{AUTH_TYPE};
$obj->{user_name} = $ENV{REMOTE_USER};
$obj->{ip} = $ENV{REMOTE_ADDR};
} else {
- my $ipvar = git_value('config', 'hooks.acl.ip-env-var') or 'SSH_CLIENT';
+ my $ipvar = git_value('config', 'hooks.acl.ip-env-var') || 'SSH_CLIENT';
if (defined($ENV{$ipvar})) {
my @a = split /\S/, $ENV{$ipvar}, 2;
$obj->{ip} = $a[0];

Return to:

Send suggestions and report system problems to the System administrator.