From bf3b5ae6ed289e7b1d43559700d1bdf3be8b38a7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 13 Oct 2018 13:29:01 +0100 Subject: [PATCH] dgit: -wg / -wgf clean check is a no-op Document this, and handle it explicitly in the clean_tree_check conditional and in the test suite. Signed-off-by: Ian Jackson --- dgit | 4 ++++ dgit.1 | 7 ++++++- tests/lib-build-modes | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dgit b/dgit index e88af4e6..52ae472b 100755 --- a/dgit +++ b/dgit @@ -6238,6 +6238,10 @@ sub clean_tree_check () { } elsif ($cleanmode =~ m{^dpkg-source}) { clean_tree_check_git_wd __ "tree contains uncommitted files (NB dgit didn't run rules clean)"; + } elsif ($cleanmode =~ m{^git}) { + # If we were actually cleaning these files would be summarily + # deleted. Since we're not, and not using the working tree + # anyway, we can just ignore them - nothing will use them. } } diff --git a/dgit.1 b/dgit.1 index 5155dc04..c3dd420b 100644 --- a/dgit.1 +++ b/dgit.1 @@ -538,7 +538,12 @@ This will delete all files which are not tracked by git. options other than dpkg-source are useful when the package's clean target is troublesome, or to avoid needing the build-dependencies. -.TP + +dgit will only actually clean the tree if it needs to +(because it needs to build the source package +or binaries from your working tree). +Otherwise any untracked files will be simply ignored. +p.TP .BR --clean=git-ff " | " -wgf Use .BR "git clean -xdff" diff --git a/tests/lib-build-modes b/tests/lib-build-modes index 837dde0c..7d0d9fdd 100644 --- a/tests/lib-build-modes +++ b/tests/lib-build-modes @@ -160,6 +160,7 @@ bm-compute-expected () { ;; none) ;; Cdpkg-source*) ;; # handled below + Cgit|Cgit-ff) ;; C*) echo "TODO bm eff_cleanmode=$eff_cleanmode" ;; *) fail "t-compute-expected-run $cleanmode ??" ;; esac -- 2.30.2