chiark / gitweb /
dgit: baredebian: Reject --clean=git
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Jun 2019 11:43:16 +0000 (12:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Jun 2019 12:51:06 +0000 (13:51 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 831a60c5e48cf16ea15ce8fb31f26a8d126ec96f..ac68c657d0b3fb6f2c4e4ec4f837e8e83d0d30ba 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6389,6 +6389,18 @@ sub clean_tree_check () {
 sub clean_tree () {
     # We always clean the tree ourselves, rather than leave it to the
     # builder (dpkg-source, or soemthing which calls dpkg-source).
+    if ($quilt_mode =~ m/baredebian/ and $cleanmode =~ m/git/) {
+       fail f_ <<END, $quilt_mode, $cleanmode;
+quilt mode %s (generally needs untracked upstream files)
+contradicts clean mode %s (which would delete them)
+END
+       # This is not 100% true: dgit build-source and push-source
+       # (for example) could operate just fine with no upstream
+       # source in the working tree.  But it doesn't seem likely that
+       # the user wants dgit to proactively delete such things.
+       # -wn, for example, would produce identical output without
+       # deleting anything from the working tree.
+    }
     if ($cleanmode =~ m{^dpkg-source}) {
        my @cmd = @dpkgbuildpackage;
        push @cmd, qw(-d) if $cleanmode =~ m{^dpkg-source-d};