From: Vincent Pit Date: Tue, 7 Oct 2008 18:15:48 +0000 (+0200) Subject: Also pass the signal to the policiy X-Git-Tag: v0.04~11 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=commitdiff_plain;h=af98236767735990609f068a18d3a7251f2efcab Also pass the signal to the policiy --- diff --git a/bin/rgit b/bin/rgit index 53312f8..2efd7b8 100755 --- a/bin/rgit +++ b/bin/rgit @@ -16,9 +16,8 @@ our $VERSION = '0.03'; BEGIN { if (-t && eval { use Term::ReadKey; 1 }) { *policy = sub { - my ($cmd, $conf, $repo, $status) = @_; + my ($cmd, $conf, $repo, $status, $signal) = @_; return NEXT unless $status; - print STDERR "git returned $status\n"; print STDERR "[a]bort, [i]gnore, [I]gnore all, [r]etry, open [s]hell ?"; ReadMode 4; my $key = ReadKey 0; @@ -38,9 +37,8 @@ BEGIN { }; } else { *policy = sub { - my ($cmd, $conf, $repo, $status) = @_; + my ($cmd, $conf, $repo, $status, $signal) = @_; return NEXT unless $status; - print STDERR "git returned $status, aborting\n"; return LAST; }; } diff --git a/lib/App/Rgit/Command/Each.pm b/lib/App/Rgit/Command/Each.pm index c042b71..ef843f7 100644 --- a/lib/App/Rgit/Command/Each.pm +++ b/lib/App/Rgit/Command/Each.pm @@ -42,8 +42,8 @@ sub run { my $code; for (@{$conf->repos}) { $_->chdir or next; - $status = $_->run($conf, @{$self->args}); - $code = $self->report($conf, $_, $status) unless defined $code; + ($status, my $signal) = $_->run($conf, @{$self->args}); + $code = $self->report($conf, $_, $status, $signal) unless defined $code; last if $code & LAST; if ($code & REDO) { undef $code; # Don't save it, that would be very dumb