chiark / gitweb /
dgit: Use a regexp to match clean mode check
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 10:17:55 +0000 (11:17 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 11:20:46 +0000 (12:20 +0100)
This will make it easier to introduce new variants.

No functional change.

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

diff --git a/dgit b/dgit
index 7f58bc5..2d7b8d4 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6201,7 +6201,7 @@ sub maybe_unapply_patches_again () {
 
 sub clean_tree_check () {
     # Not yet fully implemented.
-    if ($cleanmode eq 'check') {
+    if ($cleanmode =~ m{^check}) {
        my $leftovers = cmdoutput @git, qw(clean -xdn);
        if (length $leftovers) {
            print STDERR $leftovers, "\n" or confess $!;
@@ -6224,7 +6224,7 @@ sub clean_tree () {
        runcmd_ordryrun_local @git, qw(clean -xdf);
     } elsif ($cleanmode eq 'git-ff') {
        runcmd_ordryrun_local @git, qw(clean -xdff);
-    } elsif ($cleanmode eq 'check') {
+    } elsif ($cleanmode =~ m{^check}) {
        clean_tree_check();
     } elsif ($cleanmode eq 'none') {
     } else {