chiark / gitweb /
Move a $debug check into printdebug (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 May 2015 18:27:06 +0000 (19:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:09 +0000 (11:54 +0100)
Debian/Dgit.pm
dgit

index 2b9479db58d9b4e5f07c0301033657d449475c75..641a917ee25cb9ced753deb12a5519d2e6bc45f5 100644 (file)
@@ -92,7 +92,7 @@ sub enabledebug () {
 }
     
 sub printdebug {
-    print ::DEBUG $debugprefix, @_ or die $!;
+    print ::DEBUG $debugprefix, @_ or die $! if $debug>0;
 }
 
 sub shellquote {
diff --git a/dgit b/dgit
index 44cfb15acfbb3e968b4b6aa6c3083842033ea003..e99df73b161280fc5396431fcc4d63592f8c754f 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -410,7 +410,7 @@ sub cmdoutput_errok {
     $!=0; $?=0;
     { local $/ = undef; $d = <P>; }
     die $! if P->error;
-    if (!close P) { printdebug "=>!$?\n" if $debug>0; return undef; }
+    if (!close P) { printdebug "=>!$?\n"; return undef; }
     chomp $d;
     $d =~ m/^.*/;
     printdebug "=> \`$&'",(length $' ? '...' : ''),"\n" if $debug>0; #';