chiark / gitweb /
dgit: Honour new .clean-mode-newer access config option
[dgit.git] / dgit
diff --git a/dgit b/dgit
index de14c1ef0478eade067b3c5c4797629dbcf63d0a..8c7f288a75597f8086d02ecb25a3be1a43416226 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -7355,7 +7355,10 @@ sub parseopts_late_defaults () {
 
     if (!defined $cleanmode) {
        local $access_forpush;
 
     if (!defined $cleanmode) {
        local $access_forpush;
-       $cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');
+       $cleanmode = access_cfg('clean-mode-newer', 'RETURN-UNDEF');
+       $cleanmode = undef if $cleanmode && $cleanmode !~ m/^$cleanmode_re$/;
+
+       $cleanmode //= access_cfg('clean-mode', 'RETURN-UNDEF');
        $cleanmode //= 'dpkg-source';
 
        badcfg f_ "unknown clean-mode \`%s'", $cleanmode unless
        $cleanmode //= 'dpkg-source';
 
        badcfg f_ "unknown clean-mode \`%s'", $cleanmode unless