- # Note test_changes expects 'cgi' and 'session' parameters.
- require IkiWiki::Receive;
- IkiWiki::Receive::test_changes(%params, changes =>
- [git_parse_changes(git_commit_info($rev, 1))]);
+ # Examine changes from root of git repo, not from any subdir,
+ # in order to see all changes.
+ my ($subdir, $rootdir) = git_find_root();
+ in_git_dir($rootdir, sub {
+ my @commits=git_commit_info($sha1, 1);
+
+ 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");
+ }
+
+ git_parse_changes(1, @commits);
+ });