chiark / gitweb /
dgit: clean: Change matcbing of git to regexps
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 1090984aece5bd9bb2053af8e79f523ac2ccee5c..37d38618572b90ce5514941021ff00355059dc48 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)";
        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);
        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();
        runcmd_ordryrun_local @git, qw(clean -xdff);
     } elsif ($cleanmode =~ m{^check}) {
        clean_tree_check();