chiark / gitweb /
New --ignore-dirty option to skip noncritical check. Closes: #720895.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 71b042302dfa1e88eed02571bc47381e748f12a1..02acfa7fac5be920236d18cc4fdd51f101be3901 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -36,6 +36,7 @@ our $sign = 1;
 our $dryrun = 0;
 our $changesfile;
 our $new_package = 0;
+our $ignoredirty = 0;
 our $existing_package = 'dpkg';
 our $cleanmode = 'dpkg-source';
 
@@ -763,6 +764,7 @@ sub pull () {
 }
 
 sub check_not_dirty () {
+    return if $ignoredirty;
     my @cmd = (@git, qw(diff --quiet HEAD));
     printcmd(\*DEBUG,"+",@cmd) if $debug>0;
     $!=0; $?=0; system @cmd;
@@ -1193,6 +1195,8 @@ sub parseopts () {
                $cleanmode = $1;
            } elsif (m/^--clean=(.*)$/s) {
                badusage "unknown cleaning mode \`$1'";
+           } elsif (m/^--ignore-dirty$/s) {
+               $ignoredirty = 1;
            } else {
                badusage "unknown long option \`$_'";
            }