chiark / gitweb /
better error msgs from check_not_dirty
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 13:52:47 +0000 (14:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 13:52:47 +0000 (14:52 +0100)
debian/changelog
dgit

index 797db8a4a929eabc3a3a33eaff468c6b25b69560..f830abad88f3fe36299f71779b3c58625145ab98 100644 (file)
@@ -1,4 +1,4 @@
-dgit (0.4~~iwj) experimental; urgency=low
+dgit (0.4~pre1) experimental; urgency=low
 
   * Use dgit.debian.net vhost on alioth.  Closes #720172.
   * Usage message.  Closes #720085.
diff --git a/dgit b/dgit
index 940c89b5cb608c1cf69e046a6659b4ecf8d68b32..b3a4e9b7fc10252debef9133c3010f6be52ac498 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -707,7 +707,15 @@ sub pull () {
 }
 
 sub check_not_dirty () {
-    runcmd @git, qw(diff --quiet HEAD);
+    my @cmd = (@git, qw(diff --quiet HEAD));
+    printcmd(\*DEBUG,"+",@cmd) if $debug>0;
+    $!=0; $?=0; system @cmd;
+    return if !$! && !$?;
+    if (!$! && $?==256) {
+       fail "working tree is dirty (does not match HEAD)";
+    } else {
+       failedcmd @cmd;
+    }
 }
 
 sub commit_quilty_patch ($) {