chiark / gitweb /
dgit: Refuse to work if critical files have uncommitted changes
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 8df8f761baf9347ce341102b0fd5229aaf4fb03d..6dbf166cb72cc7ba698571f1e0c3e799a0c82456 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3825,6 +3825,17 @@ sub check_not_dirty () {
        }
     }
 
+    my @cmd = (@git, qw(status -uall --ignored --porcelain));
+    push @cmd, qw(debian/source/format debian/source/options);
+    push @cmd, @forbid;
+
+    my $bad = cmdoutput @cmd;
+    if (length $bad) {
+       fail +(__
+ "you have uncommitted changes to critical files, cannot continue:\n").
+              $bad;
+    }
+
     return if $includedirty;
 
     git_check_unmodified();