summaryrefslogtreecommitdiffstats
path: root/src/lib/Gitolite/Triggers/Writable.pm
blob: ed86e1280d4a7c23bf09ab4048c86d697bbbf0ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package Gitolite::Triggers::Writable;

use Gitolite::Rc;
use Gitolite::Common;

sub access_1 {
    my ( $repo, $aa, $result ) = @_[ 1, 3, 5 ];
    return if $aa eq 'R' or $result =~ /DENIED/;

    for my $f ( "$ENV{HOME}/.gitolite.down", "$rc{GL_REPO_BASE}/$repo.git/.gitolite.down" ) {
        next unless -f $f;
        _die slurp($f) if -s $f;
        _die "sorry, writes are currently disabled (no more info available)\n";
    }
}

1;