Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Drop commit packets with >15 commits, with a warning to the offender
  • Loading branch information
sorear committed Nov 23, 2010
1 parent 395a68f commit 303ac6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions push.psgi
Expand Up @@ -28,9 +28,15 @@ sub report {
modules::local::karmalog->fetch_metadata;

my $blob = decode_json $bits;

my @tgt = map { my ($a,$b) = split ',', $_; [ $a, "#$b" ] }
split '\+', $tgt;

if (@{ $blob->{commits} } > 15) {
common::put(\@tgt, "Some '" . $blob->{pusher}{name} ."' person just gave me a " . length($bits) . " byte commit packet. They need to be more careful in the future.");
return;
}

return if $blob->{ref} !~ m#^refs/heads/(.*)#;

my $project = $blob->{repository}{name};
Expand Down

0 comments on commit 303ac6a

Please sign in to comment.