chiark / gitweb /
dgit: Implement clean_tree_check for mode -wc
[dgit.git] / dgit
diff --git a/dgit b/dgit
index b4943a23d70118c7c177b737798e40b6622f6679..7f58bc517939fbde17cb16d9fee9e292e25137d1 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6200,7 +6200,15 @@ sub maybe_unapply_patches_again () {
 #----- other building -----
 
 sub clean_tree_check () {
-    # Not yet implemented.  The lack of this is part of #910705.
+    # Not yet fully implemented.
+    if ($cleanmode eq 'check') {
+       my $leftovers = cmdoutput @git, qw(clean -xdn);
+       if (length $leftovers) {
+           print STDERR $leftovers, "\n" or confess $!;
+           fail __
+ "tree contains uncommitted files and --clean=check specified";
+       }
+    }
 }
 
 sub clean_tree () {
@@ -6217,12 +6225,7 @@ sub clean_tree () {
     } elsif ($cleanmode eq 'git-ff') {
        runcmd_ordryrun_local @git, qw(clean -xdff);
     } elsif ($cleanmode eq 'check') {
-       my $leftovers = cmdoutput @git, qw(clean -xdn);
-       if (length $leftovers) {
-           print STDERR $leftovers, "\n" or confess $!;
-           fail __
- "tree contains uncommitted files and --clean=check specified";
-       }
+       clean_tree_check();
     } elsif ($cleanmode eq 'none') {
     } else {
        die "$cleanmode ?";