- $git_dir=$rootdir;
-
- 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");
- }
+ in_git_dir($rootdir, sub {
+ my @commits=git_commit_info($sha1, 1);
+
+ if (! @commits) {
+ error "unknown commit"; # just in case
+ }