From 653829c95e2da6d59f80b27dc73d3bd5c7bdd6c3 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Tue, 29 Aug 2023 19:22:05 -0400 Subject: [PATCH] clone: more forcefully clean clones of untracked files and empty dirs --- ofborg/src/clone.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ofborg/src/clone.rs b/ofborg/src/clone.rs index ee10a90..5e2fa46 100644 --- a/ofborg/src/clone.rs +++ b/ofborg/src/clone.rs @@ -137,6 +137,16 @@ pub trait GitClonable { .stdout(Stdio::null()) .status()?; + debug!("git clean -x -d --force"); + Command::new("git") + .arg("clean") + .arg("-x") + .arg("-d") + .arg("--force") + .current_dir(self.clone_to()) + .stdout(Stdio::null()) + .status()?; + lock.unlock(); Ok(())