]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Rcs/git.pm
* Support git authors of the form "joey <joey>", which is common when
[ikiwiki.git] / IkiWiki / Rcs / git.pm
index 563d10859eb6edb71a3ba03e838a9dd319f704d5..3407354c9a28a5e9ccbe4f313ade0f4dd40ed6b2 100644 (file)
@@ -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,9 +458,9 @@ 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);