X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/33f42db2ea0422551223c255d85d9f4e45ee404b..80edf46ff216a547676de9e7902072777f715a35:/IkiWiki/Plugin/git.pm diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index e10283f59..c5c83a3a7 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -613,11 +613,15 @@ sub rcs_getctime ($) { # Remove srcdir prefix $file =~ s/^\Q$config{srcdir}\E\/?//; - my @raw_lines = run_or_die('git', 'log', '--reverse', '--follow', + my @raw_lines = run_or_die('git', 'log', + '--follow', '--no-merges', '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c', '-r', '--', $file); - my $first = parse_diff_tree("", \@raw_lines); - my $ctime = $first->{'author_epoch'}; + my @ci; + while (my $parsed = parse_diff_tree("", \@raw_lines)) { + push @ci, $parsed; + } + my $ctime = $ci[$#ci]->{'author_epoch'}; debug("ctime for '$file': ". localtime($ctime)); return $ctime;