X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/26dae8f04955915f4203fab4bd5301c959f7771a..e68cce6d1d51a513f54ab7d7e77e7c249aad3c06:/IkiWiki/Plugin/git.pm diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index ad58231e0..c5c83a3a7 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -613,9 +613,15 @@ sub rcs_getctime ($) { # Remove srcdir prefix $file =~ s/^\Q$config{srcdir}\E\/?//; - my @sha1s = run_or_non('git', 'rev-list', 'HEAD', '--', $file); - my $ci = git_commit_info($sha1s[$#sha1s], 1); - my $ctime = $ci->{'author_epoch'}; + my @raw_lines = run_or_die('git', 'log', + '--follow', '--no-merges', + '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c', + '-r', '--', $file); + 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;