Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

jenkins: force fetch on each PR. #895

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .ci/jenkins_job_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ 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}"

# 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
Expand Down