X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/8de136222e0eafe506c5dee4b2f918620ca7a065..a22d9f9721f89111cba2efbd2b795e3edfcb08b8:/IkiWiki/Rcs/git.pm?ds=sidebyside diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index 9f64b8630..3407354c9 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -23,8 +23,6 @@ sub _safe_git (&@) { #{{{ 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}: $!"); @@ -40,7 +38,7 @@ sub _safe_git (&@) { #{{{ close $OUT; - ($error_handler || sub { })->("'@cmdline' failed: $!") if $?; + $error_handler->("'@cmdline' failed: $!") if $? && $error_handler; return wantarray ? @lines : ($? == 0); } @@ -182,7 +180,7 @@ sub _parse_diff_tree ($@) { #{{{ $ci{ "${who}_epoch" } = $epoch; $ci{ "${who}_tz" } = $tz; - if ($name =~ m/^([^<]+) <([^@]+)/) { + if ($name =~ m/^([^<]+) <([^@>]+)/) { my ($fullname, $username) = ($1, $2); $ci{"${who}_fullname"} = $fullname; $ci{"${who}_username"} = $username; @@ -460,14 +458,14 @@ sub rcs_notify () { #{{{ } #}}} 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; } #}}}