From d4c9cca82d4a1bba356fb88210e2d8b1d9b942fc Mon Sep 17 00:00:00 2001 From: Nicusor Serban Date: Fri, 12 May 2023 17:41:28 +0200 Subject: [PATCH] Make sure to pull master and git diff with origin remote rather than local --- src/org/stan/Utils.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/stan/Utils.groovy b/src/org/stan/Utils.groovy index 7e4139c..214ca00 100644 --- a/src/org/stan/Utils.groovy +++ b/src/org/stan/Utils.groovy @@ -102,7 +102,7 @@ def verifyChanges(String sourceCodePaths, String mergeWith = "develop") { else { sh(script: "git checkout -f ${env.CHANGE_BRANCH}", returnStdout: false) commitHash = sh(script: "git rev-parse HEAD | tr '\\n' ' '", returnStdout: true) - sh(script: "git checkout -f ${changeTarget}", returnStdout: false) + sh(script: "git checkout -f ${changeTarget} && git pull", returnStdout: false) sh(script: "git checkout -f ${env.CHANGE_BRANCH}", returnStdout: false) } @@ -150,12 +150,12 @@ def verifyChanges(String sourceCodePaths, String mergeWith = "develop") { } } else{ - println "Comparing differences between current ${commitHash} and target ${changeTarget}" + println "Comparing differences between current ${commitHash} and target origin/${changeTarget}" if (mergeStatus != 0){ differences = sh(script: """ for i in ${sourceCodePaths}; do - git diff ${commitHash} ${changeTarget} -- \$i + git diff ${commitHash} origin/${changeTarget} -- \$i done """, returnStdout: true) }