From edfc75e027cfc08ea69a6f2db04f0c9d975ab46c Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 15 Jul 2013 22:01:04 +0000 Subject: [PATCH] Clear workspace before cloning in GGP. * modules/jenkins/files/slave_scripts/gerrit-git-prep.sh: The git-clone subcommand fails spectacularly when its destination is set to a non-empty directory. In the case of gerrit-git-prep this can happen when files are left behind in a workspace with no .git tree, and then the job is changed to run GGP later. Work around it by forcibly removing any previous workspace contents before cloning, but show a listing of any contents first for the benefit of troubleshooting such situations. Change-Id: I0662ee68ee2a0e7a66a4d85c8cc7aea8bf0c17c0 --- modules/jenkins/files/slave_scripts/gerrit-git-prep.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh b/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh index 615ff8a417..623468c1c8 100755 --- a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh +++ b/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh @@ -29,6 +29,8 @@ fi set -x if [[ ! -e .git ]] then + ls -a + rm -fr .[^.]* * git clone $GERRIT_SITE/p/$ZUUL_PROJECT . fi git remote set-url origin $GERRIT_SITE/p/$ZUUL_PROJECT