aboutsummaryrefslogtreecommitdiff
path: root/git-fmt-merge-msg.perl
diff options
context:
space:
mode:
Diffstat (limited to 'git-fmt-merge-msg.perl')
-rwxr-xr-xgit-fmt-merge-msg.perl13
1 files changed, 12 insertions, 1 deletions
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index be2a48cf6..f86231e14 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -7,6 +7,7 @@
use strict;
use Git;
+use Error qw(:try);
my $repo = Git->repository();
@@ -31,7 +32,17 @@ sub andjoin {
}
sub repoconfig {
- my ($val) = $repo->command_oneline('repo-config', '--get', 'merge.summary');
+ my $val;
+ try {
+ $val = $repo->command_oneline('repo-config', '--get', 'merge.summary');
+ } catch Git::Error::Command with {
+ my ($E) = shift;
+ if ($E->value() == 1) {
+ return undef;
+ } else {
+ throw $E;
+ }
+ };
return $val;
}