From 55aaf807ebd482310127b51440e9c9f1e36d131c Mon Sep 17 00:00:00 2001 From: Ronny Esterluss Date: Thu, 31 Jul 2014 19:03:25 +0200 Subject: [PATCH] added clean command --- src/lib/Hydra/Plugin/GitInput.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/Hydra/Plugin/GitInput.pm b/src/lib/Hydra/Plugin/GitInput.pm index 8c02de7e..86674335 100644 --- a/src/lib/Hydra/Plugin/GitInput.pm +++ b/src/lib/Hydra/Plugin/GitInput.pm @@ -42,6 +42,9 @@ sub _cloneRepo { # Checkout the branch to look at its content. $res = run(cmd => ["git", "checkout", "--force", "$branch"], dir => $clonePath); die "error checking out Git branch '$branch' at `$uri':\n$res->{stderr}" if $res->{status}; + # Clean to remove potentially present artifacts after forcing branch switch + $res = run(cmd => ["git", "clean", "-d", "-x", "--force", "--force"], dir => $clonePath); + print STDERR "warning: `git clean -d -x --force --force' failed::\n$res->{stderr}" if $res->{status}; if (-f ".topdeps") { # This is a TopGit branch. Fetch all the topic branches so