summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/jenkins-build-common.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh
index 779f965..895cd63 100644
--- a/contrib/jenkins-build-common.sh
+++ b/contrib/jenkins-build-common.sh
@@ -73,18 +73,17 @@ have_repo() {
fi
cd "$base"
- if [ ! -d "$repo" ]; then
- git clone "$git_url/$repo" "$repo"
- fi
+ rm -rf "$repo"
+ git clone "$git_url/$repo" "$repo"
+
cd "$repo"
- git fetch origin
- # Figure out whether we need to prepend origin/ to find branches in upstream
+ # Figure out whether we need to prepend origin/ to find branches in upstream.
+ # Doing this allows using git hashes instead of a branch name.
if git rev-parse "origin/$branch"; then
branch="origin/$branch"
fi
- git branch -D build_branch || true
git checkout -b build_branch "$branch"
rm -rf *
git reset --hard "$branch"