summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/git.pm4
-rw-r--r--IkiWiki/Plugin/mercurial.pm4
2 files changed, 4 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index b386ab71b..68b114a73 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -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));
diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm
index 6c4855e57..11fdec529 100644
--- a/IkiWiki/Plugin/mercurial.pm
+++ b/IkiWiki/Plugin/mercurial.pm
@@ -236,7 +236,7 @@ sub rcs_getctime ($) {
# XXX filename passes through the shell here, should try to avoid
# that just in case
- my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", '1',
+ my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v",
"--style", "default", "$config{srcdir}/$file");
open (my $out, "@cmdline |");
@@ -249,7 +249,7 @@ sub rcs_getctime ($) {
eval q{use Date::Parse};
error($@) if $@;
- my $ctime = str2time($log[0]->{"date"});
+ my $ctime = str2time($log[$#log]->{"date"});
return $ctime;
}