mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
tools: fix exception in checkout ref script:
decode bytes before searching with RegEx
This commit is contained in:
@@ -34,16 +34,20 @@ def target_branch_candidates(proj_name):
|
|||||||
except (KeyError, TypeError):
|
except (KeyError, TypeError):
|
||||||
pass
|
pass
|
||||||
# branch name read from IDF
|
# branch name read from IDF
|
||||||
git_describe = subprocess.check_output(["git", "describe", "--tags", "HEAD"])
|
try:
|
||||||
match = IDF_GIT_DESCRIBE_PATTERN.search(git_describe)
|
git_describe = subprocess.check_output(["git", "describe", "--tags", "HEAD"])
|
||||||
if match:
|
match = IDF_GIT_DESCRIBE_PATTERN.search(git_describe.decode())
|
||||||
major_revision = match.group(1)
|
if match:
|
||||||
minor_revision = match.group(2)
|
major_revision = match.group(1)
|
||||||
# release branch
|
minor_revision = match.group(2)
|
||||||
candidates.append("release/v{}.{}".format(major_revision, minor_revision))
|
# release branch
|
||||||
# branch to match all major branches, like v3.x or v3
|
candidates.append("release/v{}.{}".format(major_revision, minor_revision))
|
||||||
candidates.append("release/v{}.x".format(major_revision))
|
# branch to match all major branches, like v3.x or v3
|
||||||
candidates.append("release/v{}".format(major_revision))
|
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
|
return [c for c in candidates if c] # filter out null value
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user