From eaed2b36f0be1fe107e3085310573c673f927743 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 6 Feb 2018 20:51:10 +0000 Subject: [PATCH] jenkins: force fetch on each PR. If a PR was updated with a push force. We need to force to update the brach to test this commit does: - clean current branch. - If testing a PR, force to fetch and pull a brach with latest changes. Fixes: #894 Signed-off-by: Jose Carlos Venegas Munoz --- .ci/jenkins_job_build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/jenkins_job_build.sh b/.ci/jenkins_job_build.sh index 5a27cc3f0..083745d50 100755 --- a/.ci/jenkins_job_build.sh +++ b/.ci/jenkins_job_build.sh @@ -56,6 +56,9 @@ pr_number= [ "${ghprbPullId}" ] && [ "${ghprbTargetBranch}" ] && pr_number="${ghprbPullId}" +# Make sure repo is clean +git clean -dfx + if [ -n "$pr_number" ] then pr_branch="PR_${pr_number}" @@ -63,7 +66,7 @@ then # Create a separate branch for the PR. This is required to allow # checkcommits to be able to determine how the PR differs from # "master". - git fetch origin "pull/${pr_number}/head:${pr_branch}" + git fetch --force origin "pull/${pr_number}/head:${pr_branch}" git checkout "${pr_branch}" git rebase "origin/${ghprbTargetBranch}" else