module.exports = function (grunt) {
    var is_cleanup   = !!grunt.option('cleanup'),
        cleanup_only = global.branch ? [global.branch_prefix + global.branch + '/.'] : (global.release_target ? ['.', '!beta/.', '!translations/.'] : ['.']),
        source       = global.branch ? [global.branch_prefix + global.branch + '/**'] : ['**/*', '!' + (global.branch_prefix || 'br_') + '*/**', '!translations/**', '!beta/**'];

    return {
        all: {
            options: {
                base   : 'dist',
                add    : (is_cleanup ? false : true),
                only   : cleanup_only,
                message: 'Auto-generated commit',
            },
            src: source
        }
    }
};

@@ -160,17 +160,18 @@
 nch + '/
-.
+**
 '%5D : (gl
@@ -194,17 +194,20 @@
 get ? %5B'
-.
+**/*
 ', '!bet
@@ -208,17 +208,18 @@
  '!beta/
-.
+**
 ', '!tra
@@ -232,17 +232,21 @@
 ons/
-.
+**
 '%5D : %5B'
-.
+**/*
 '%5D),

Fix release --cleanup