aboutsummaryrefslogtreecommitdiffhomepage
path: root/devel/nmbug/nmbug
diff options
context:
space:
mode:
Diffstat (limited to 'devel/nmbug/nmbug')
-rwxr-xr-xdevel/nmbug/nmbug13
1 files changed, 10 insertions, 3 deletions
diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index b18ded7b..4a797226 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -63,13 +63,20 @@ sub git_pipe {
spawn ($envref, defined $ioref ? $ioref : (), defined $dir ? $dir : (), @_);
}
-sub git {
+sub git_with_status {
my $fh = git_pipe (@_);
my $str = join ('', <$fh>);
- unless (close $fh) {
+ close $fh;
+ my $status = $?;
+ chomp($str);
+ return ($str, $status);
+}
+
+sub git {
+ my ($str, $status) = git_with_status (@_);
+ if ($status) {
die "'git @_' exited with nonzero value\n";
}
- chomp($str);
return $str;
}