Fix branch checkout order
Since we're deprecating override-branch in favor of override-checkout,
favor override-checkout when deciding which to use.
Also, change an if to elif to make sure we only do one of these.
Change-Id: I55a94188d9894df27d99416cd3cefff8f3a64718
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index 759f327..5e3794b 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -768,22 +768,22 @@
branches = repo.getBranches()
refs = [r.name for r in repo.getRefs()]
selected_ref = None
- if project_override_branch in branches:
- selected_ref = project_override_branch
- self.log.info("Checking out %s project override branch %s",
- project_name, selected_ref)
if project_override_checkout in refs:
selected_ref = project_override_checkout
self.log.info("Checking out %s project override ref %s",
project_name, selected_ref)
- elif job_override_branch in branches:
- selected_ref = job_override_branch
- self.log.info("Checking out %s job override branch %s",
+ elif project_override_branch in branches:
+ selected_ref = project_override_branch
+ self.log.info("Checking out %s project override branch %s",
project_name, selected_ref)
elif job_override_checkout in refs:
selected_ref = job_override_checkout
self.log.info("Checking out %s job override ref %s",
project_name, selected_ref)
+ elif job_override_branch in branches:
+ selected_ref = job_override_branch
+ self.log.info("Checking out %s job override branch %s",
+ project_name, selected_ref)
elif ref and ref.startswith('refs/heads/'):
selected_ref = ref[len('refs/heads/'):]
self.log.info("Checking out %s branch ref %s",