From ea733a7a6cd61a048d062a302b2719ca6c74b7bc Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Tue, 9 Jul 2024 13:50:27 +0200 Subject: [PATCH] Manage bad branch names --- ci_tools/bot_tools/bot_funcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci_tools/bot_tools/bot_funcs.py b/ci_tools/bot_tools/bot_funcs.py index 0fae3682f5..fd4aa06aba 100644 --- a/ci_tools/bot_tools/bot_funcs.py +++ b/ci_tools/bot_tools/bot_funcs.py @@ -122,8 +122,8 @@ def __init__(self, pr_id = None, check_run_id = None, commit = None): self._source_repo = self._pr_details["base"]["repo"]["full_name"] if commit: self._ref = commit - if '/' in self._ref: - _, _, branch = self._ref.split('/',2) + if self._ref.count('/') == 2: + _, _, branch = self._ref.split('/') branch_info = self._GAI.get_branch_details(branch) self._ref = branch_info['commit']['sha'] else: