tools: fix exception in checkout ref script:
decode bytes before searching with RegEx
This commit is contained in:
parent
9ecd0436f5
commit
a626061f3c
1 changed files with 14 additions and 10 deletions
|
@ -34,8 +34,9 @@ def target_branch_candidates(proj_name):
|
|||
except (KeyError, TypeError):
|
||||
pass
|
||||
# branch name read from IDF
|
||||
try:
|
||||
git_describe = subprocess.check_output(["git", "describe", "--tags", "HEAD"])
|
||||
match = IDF_GIT_DESCRIBE_PATTERN.search(git_describe)
|
||||
match = IDF_GIT_DESCRIBE_PATTERN.search(git_describe.decode())
|
||||
if match:
|
||||
major_revision = match.group(1)
|
||||
minor_revision = match.group(2)
|
||||
|
@ -44,6 +45,9 @@ def target_branch_candidates(proj_name):
|
|||
# branch to match all major branches, like v3.x or v3
|
||||
candidates.append("release/v{}.x".format(major_revision))
|
||||
candidates.append("release/v{}".format(major_revision))
|
||||
except subprocess.CalledProcessError:
|
||||
# this should not happen as IDF should have describe message
|
||||
pass
|
||||
|
||||
return [c for c in candidates if c] # filter out null value
|
||||
|
||||
|
|
Loading…
Reference in a new issue