]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Git.pm
tighten up digit matches to ASCII for git output
[public-inbox.git] / lib / PublicInbox / Git.pm
index 9a38d7c8dce83bc0aa13d0ee870ab33924390580..68445b3cc28961379e763908e8b93b9d5f8e061a 100644 (file)
@@ -141,7 +141,7 @@ again:
                }
                return;
        }
-       $head =~ /^[0-9a-f]{40} \S+ (\d+)$/ or
+       $head =~ /^[0-9a-f]{40} \S+ ([0-9]+)$/ or
                fail($self, "Unexpected result from git cat-file: $head");
 
        my $size = $1;
@@ -211,9 +211,10 @@ sub check {
 }
 
 sub _destroy {
-       my ($self, $in, $out, $pid) = @_;
+       my ($self, $in, $out, $pid, $err) = @_;
        my $p = delete $self->{$pid} or return;
        delete @$self{($in, $out)};
+       delete $self->{$err} if $err; # `err_c'
        waitpid $p, 0;
 }
 
@@ -243,7 +244,7 @@ sub qx {
 sub cleanup {
        my ($self) = @_;
        _destroy($self, qw(in out pid));
-       _destroy($self, qw(in_c out_c pid_c));
+       _destroy($self, qw(in_c out_c pid_c err_c));
        !!($self->{pid} || $self->{pid_c});
 }
 
@@ -318,7 +319,7 @@ sub modified ($) {
        foreach my $oid (<$fh>) {
                chomp $oid;
                my $buf = cat_file($self, $oid) or next;
-               $$buf =~ /^committer .*?> (\d+) [\+\-]?\d+/sm or next;
+               $$buf =~ /^committer .*?> ([0-9]+) [\+\-]?[0-9]+/sm or next;
                my $cmt_time = $1;
                $modified = $cmt_time if $cmt_time > $modified;
        }