]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fix rcs_getctime to return first, not last, change time
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 20 Mar 2009 20:32:37 +0000 (16:32 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 20 Mar 2009 20:32:37 +0000 (16:32 -0400)
This was being buggy and returning the file's last change time, not its
creation time.

(I checked all the others (except tla) and they're ok.)

IkiWiki/Plugin/git.pm

index b386ab71bfa6b0d0feffcb53fb167f17c1ac016d..68b114a7328332a54d8e66426bd09dc1eec0b030 100644 (file)
@@ -594,8 +594,8 @@ sub rcs_getctime ($) {
        # Remove srcdir prefix
        $file =~ s/^\Q$config{srcdir}\E\/?//;
 
-       my $sha1  = git_sha1($file);
-       my $ci    = git_commit_info($sha1, 1);
+       my @sha1s = run_or_non('git', 'rev-list', 'HEAD', '--', $file);
+       my $ci    = git_commit_info($sha1s[$#sha1s], 1);
        my $ctime = $ci->{'author_epoch'};
        debug("ctime for '$file': ". localtime($ctime));