From 7ad3acc8faa151e307c82b659f884205ef47012b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 27 Jan 2021 17:04:13 +0100 Subject: Merging upstream version 2.9.3. Signed-off-by: Daniel Baumann --- pre_commit/languages/dotnet.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pre_commit/languages/dotnet.py') diff --git a/pre_commit/languages/dotnet.py b/pre_commit/languages/dotnet.py index a8abc86..094d2f1 100644 --- a/pre_commit/languages/dotnet.py +++ b/pre_commit/languages/dotnet.py @@ -12,7 +12,6 @@ from pre_commit.hook import Hook from pre_commit.languages import helpers from pre_commit.prefix import Prefix from pre_commit.util import clean_path_on_failure -from pre_commit.util import rmtree ENVIRONMENT_DIR = 'dotnetenv' BIN_DIR = 'bin' @@ -76,9 +75,9 @@ def install_environment( ), ) - # Cleanup build output - for d in ('bin', 'obj', build_dir): - rmtree(prefix.path(d)) + # Clean the git dir, ignoring the environment dir + clean_cmd = ('git', 'clean', '-ffxd', '-e', f'{ENVIRONMENT_DIR}-*') + helpers.run_setup_cmd(prefix, clean_cmd) def run_hook( -- cgit v1.2.3