chiark / gitweb /
Honour *.clean-mode configuration setting for --clean= mode.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index bde052e..8396971 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3312,7 +3312,14 @@ if (!defined $quilt_mode) {
     $quilt_mode = $1;
 }
 
-$cleanmode //= 'dpkg-source';    
+if (!defined $cleanmode) {
+    local $access_forpush;
+    $cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');
+    $cleanmode //= 'dpkg-source';
+
+    badcfg "unknown clean-mode \`$cleanmode'" unless
+       $cleanmode =~ m/^($cleanmode_re)$(?!\n)/s;
+}
 
 my $fn = ${*::}{"cmd_$cmd"};
 $fn or badusage "unknown operation $cmd";