Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- my @banned_string= qw/push -f origin (master|release.*)/;
- sub banned{
- my @banned = @banned_string[0..$#ARGV];
- die "error" if equal(\@banned , [@ARGV]);
- }
- # Destructive function!
- sub equal {
- my ($list_a, $list_b) = @_;
- return 1 unless @$list_b;
- my $next_banned_param = shift @$list_a;
- return 0 if !( (shift @$list_b) =~/^$next_banned_param$/);
- equal($list_a, $list_b);
- }
- # For debugging purposes. uncomment if needed
- # Don't print anything extra in stdout if you want
- # vim/emacs integration to work
- # open my $fh, '>>/tmp/lal';
- # print $fh "@ARGV\n";
- # close $fh;
- banned if 1 < @ARGV;
- exec '/usr/bin/git', @ARGV;
Add Comment
Please, Sign In to add comment