summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-08-22 14:52:47 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-08-22 14:52:47 +0100
commitf8ad84e8235e1741857849e46bcc70c2f5bc3790 (patch)
treec654d863522e8af29fc3254e1a4d42a25b605369 /dgit
parent87c98ffb9684cb31a1f6df93ca1d9e9c962e1066 (diff)
better error msgs from check_not_dirty
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit10
1 files changed, 9 insertions, 1 deletions
diff --git a/dgit b/dgit
index 940c89b..b3a4e9b 100755
--- 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 ($) {