From 5f12e27897ff2c3f9d3461503243013947d00b2c Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 29 Apr 2014 13:20:57 -0700 Subject: [PATCH] Drop the ref from the tag fetch in GGP If you start with an out of date repo (we do -- we clone from cached git repos on our images) and the git remote update fails (eg due to mirror sync issues) and you then do a fetch with a ref argument (eg refs/tags/foo), it will fail with: error: no such remote ref refs/tags/foo However, git fetch --tags will get all the tags from the zuul merger, which is what we really care about, and the subsequent checkout and reset will make sure that we really did get the tag we wanted. Therefore, remove the ref argument that can cause these occasional failures. Change-Id: Iaed8b82204a3eddc7ee418ebe94637f2a371d25b --- modules/jenkins/files/slave_scripts/gerrit-git-prep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh b/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh index 8469300dc2..8b0c8b86fb 100755 --- a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh +++ b/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh @@ -71,7 +71,7 @@ fi if echo "$ZUUL_REF" | grep -q ^refs/tags/ then - git fetch --tags $ZUUL_URL/$ZUUL_PROJECT $ZUUL_REF + git fetch --tags $ZUUL_URL/$ZUUL_PROJECT git checkout $ZUUL_REF git reset --hard $ZUUL_REF elif [ -z "$ZUUL_NEWREV" ]