X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/33f42db2ea0422551223c255d85d9f4e45ee404b..73f4a8835876c8cb07808367cd72d9ae972893e8:/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;