if (!$pid) {
# In child.
- open STDERR, ">&STDOUT"
- or error("Cannot dup STDOUT: $!");
# Git commands want to be in wc.
chdir $config{srcdir}
or error("Cannot chdir to $config{srcdir}: $!");
close $OUT;
- ($error_handler || sub { })->("'@cmdline' failed: $!") if $?;
+ $error_handler->("'@cmdline' failed: $!") if $? && $error_handler;
return wantarray ? @lines : ($? == 0);
}
} #}}}
sub rcs_getctime ($) { #{{{
- # Get the ctime of file.
-
- my ($file) = @_;
+ my $file=shift;
+ # Remove srcdir prefix
+ $file =~ s/^\Q$config{srcdir}\E\/?//;
my $sha1 = git_sha1($file);
my $ci = git_commit_info($sha1);
my $ctime = $ci->{'author_epoch'};
- debug("ctime for '$file': ". localtime($ctime) . "\n");
+ debug("ctime for '$file': ". localtime($ctime));
return $ctime;
} #}}}