]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/git.pm
Fix escaping of filenames in historyurl. (Thanks, aj)
[git.ikiwiki.info.git] / IkiWiki / Plugin / git.pm
index f8e16859bed71d28d3dbd6b5ee3a5877782450a2..3fa29b22f78b6f47ea27b2f79950782b9ef03223 100644 (file)
@@ -688,7 +688,7 @@ sub findtimes ($$) {
        if (! keys %time_cache) {
                my $date;
                foreach my $line (run_or_die('git', 'log',
-                               '--pretty=format:%ct',
+                               '--pretty=format:%at',
                                '--name-only', '--relative')) {
                        if (! defined $date && $line =~ /^(\d+)$/) {
                                $date=$line;
@@ -848,9 +848,20 @@ sub rcs_preprevert ($) {
        # in order to see all changes.
        my ($subdir, $rootdir) = git_find_root();
        $git_dir=$rootdir;
-       my @ret=git_parse_changes(git_commit_info($sha1, 1));
+       my @commits=git_commit_info($sha1, 1);
        $git_dir=undef;
-       return @ret;
+
+       if (! @commits) {
+               error "unknown commit"; # just in case
+       }
+
+       # git revert will fail on merge commits. Add a nice message.
+       if (exists $commits[0]->{parents} &&
+           @{$commits[0]->{parents}} > 1) {
+               error gettext("you are not allowed to revert a merge");
+       }
+
+       return git_parse_changes(@commits);
 }
 
 sub rcs_revert ($) {