chiark / gitweb /
dgit: Refuse to work if critical files have uncommitted changes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Oct 2018 00:33:21 +0000 (01:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Oct 2018 00:41:13 +0000 (01:41 +0100)
Notably, d/source/format and options, and the forbidden files.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 8df8f76..6dbf166 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();