diff --git a/vars/getCheckoutInfo.groovy b/vars/getCheckoutInfo.groovy index e64f1e3e288882..e273d0bfd2a7f2 100644 --- a/vars/getCheckoutInfo.groovy +++ b/vars/getCheckoutInfo.groovy @@ -1,8 +1,9 @@ -def call(scmVars) { - def repoInfo = [:] +def call() { - repoInfo.branch = env.ghprbSourceBranch ?: scmVars.GIT_LOCAL_BRANCH ?: scmVars.GIT_BRANCH - repoInfo.targetBranch = env.ghprbTargetBranch + def repoInfo = [ + branch: env.ghprbSourceBranch ?: params.branch_specifier ?: 'missing branch_specifier' + targetBranch: env.ghprbTargetBranch + ] dir("kibana") { repoInfo.commit = sh( diff --git a/vars/workers.groovy b/vars/workers.groovy index 416f8e3c090a03..e05ed9b625726f 100644 --- a/vars/workers.groovy +++ b/vars/workers.groovy @@ -56,9 +56,10 @@ def base(Map params, Closure closure) { if (config.scm) { // Try to clone from Github up to 8 times, waiting 15 secs between attempts retryWithDelay(8, 15) { - checkoutInfo = getCheckoutInfo(checkout(scm)) + checkout scm } + checkoutInfo = getCheckoutInfo() ciStats.reportGitInfo( checkoutInfo.branch, checkoutInfo.commit,