osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29592 ) Change subject: obs: lib.git.get_default_branch: add function ...................................................................... obs: lib.git.get_default_branch: add function Refactor checkout_default_branch so the get_default_branch logic can be used from another function in a future patch. Related: OS#2385 Change-Id: If3f0ab500ff165d81f61b19ad41af90bd39dce8f --- M scripts/obs/lib/git.py 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/scripts/obs/lib/git.py b/scripts/obs/lib/git.py index 8dc57ae..aab0533 100644 --- a/scripts/obs/lib/git.py +++ b/scripts/obs/lib/git.py @@ -65,11 +65,14 @@ lib.run_cmd(["git", "review", "-d", str(gerrit_id)], cwd=repo_path) -def checkout_default_branch(project): - branch = lib.config.git_branch_default +def get_default_branch(project): if project in lib.config.git_branch_other: - branch = lib.config.git_branch_other[project] + return lib.config.git_branch_other[project] + return lib.config.git_branch_default + +def checkout_default_branch(project): + branch = get_default_branch(project) checkout(project, f"origin/{branch}") -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29592 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: If3f0ab500ff165d81f61b19ad41af90bd39dce8f Gerrit-Change-Number: 29592 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged