chiark / gitweb /
dgit: clean: Change matcbing of git to regexps
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Jan 2019 11:15:13 +0000 (11:15 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Jan 2019 12:43:12 +0000 (12:43 +0000)
We are going to have some ,... suffixes on this, so we need more
general matching.

No functional change with the current set of clean modes.

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

diff --git a/dgit b/dgit
index 1090984..37d3861 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6269,9 +6269,9 @@ sub clean_tree () {
        runcmd_ordryrun_local @cmd;
        clean_tree_check_git_wd __
  "tree contains uncommitted files (after running rules clean)";
-    } elsif ($cleanmode eq 'git') {
+    } elsif ($cleanmode =~ m{^git(?!-)}) {
        runcmd_ordryrun_local @git, qw(clean -xdf);
-    } elsif ($cleanmode eq 'git-ff') {
+    } elsif ($cleanmode =~ m{^git-ff}) {
        runcmd_ordryrun_local @git, qw(clean -xdff);
     } elsif ($cleanmode =~ m{^check}) {
        clean_tree_check();