Skip to content

Commit

Permalink
[7.x] [ci/getCheckoutInfo] retry fetching upstream changes to calcula…
Browse files Browse the repository at this point in the history
…te mergeBase (#69320) (#69335)

Co-authored-by: spalger <[email protected]>

Co-authored-by: spalger <[email protected]>
  • Loading branch information
Spencer and spalger authored Jun 16, 2020
1 parent 0228ad7 commit 71663a4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions vars/getCheckoutInfo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ def call(branchOverride) {
).trim()

if (repoInfo.targetBranch) {
sh(
script: "git fetch origin ${repoInfo.targetBranch}",
label: "fetch latest from '${repoInfo.targetBranch}' at origin"
)
// Try to clone fetch from Github up to 8 times, waiting 15 secs between attempts
retryWithDelay(8, 15) {
sh(
script: "git fetch origin ${repoInfo.targetBranch}",
label: "fetch latest from '${repoInfo.targetBranch}' at origin"
)
}

repoInfo.mergeBase = sh(
script: "git merge-base HEAD FETCH_HEAD",
label: "determining merge point with '${repoInfo.targetBranch}' at origin",
Expand Down

0 comments on commit 71663a4

Please sign in to comment.