X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9ca9959eda17ca85ca1550353d09ee33f6bb0469..65e726f201d7b9919271cfe7e8a7314a6abf0fc3:/IkiWiki/Plugin/git.pm?ds=inline diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 892b711d8..3fa29b22f 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -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,8 +848,20 @@ sub rcs_preprevert ($) { # in order to see all changes. my ($subdir, $rootdir) = git_find_root(); $git_dir=$rootdir; - return git_parse_changes(git_commit_info($sha1, 1)); + my @commits=git_commit_info($sha1, 1); $git_dir=undef; + + 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 ($) {