Guest User

Untitled

a guest
Jan 24th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. my @banned_string= qw/push -f origin (master|release.*)/;
  6.  
  7. sub banned{
  8. my @banned = @banned_string[0..$#ARGV];
  9. die "error" if equal(\@banned , [@ARGV]);
  10. }
  11.  
  12. # Destructive function!
  13. sub equal {
  14. my ($list_a, $list_b) = @_;
  15. return 1 unless @$list_b;
  16. my $next_banned_param = shift @$list_a;
  17. return 0 if !( (shift @$list_b) =~/^$next_banned_param$/);
  18. equal($list_a, $list_b);
  19. }
  20.  
  21. # For debugging purposes. uncomment if needed
  22. # Don't print anything extra in stdout if you want
  23. # vim/emacs integration to work
  24. # open my $fh, '>>/tmp/lal';
  25. # print $fh "@ARGV\n";
  26. # close $fh;
  27.  
  28. banned if 1 < @ARGV;
  29. exec '/usr/bin/git', @ARGV;
Add Comment
Please, Sign In to add comment