for (charmPath in charms) {
def directory = charmPath
if (fileExists("$charmPath/charmcraft.yaml")) {
- CHECK_CHANGES = "git diff --name-only origin/$GERRIT_BRANCH -- $directory |wc -l"
+ if (isMergeJob) {
+ CHECK_CHANGES = "git diff --name-only HEAD^1 -- $directory |wc -l"
+ } else {
+ CHECK_CHANGES = "git diff --name-only origin/$GERRIT_BRANCH -- $directory |wc -l"
+ }
charmsChanged = sh(returnStdout:true, script: CHECK_CHANGES).trim()
- if (charmsChanged != "0" || isMergeJob) {
+
+ if (charmsChanged != "0") {
println("$directory has changes, rebuilding")
parallelSteps[directory] = {