Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patching: accept a sha1 in BASE_GIT_TAG (as well as branch or tag) #5819

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/tools/patching.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,14 @@
try:
BASE_GIT_REVISION = git_repo.branches[BASE_GIT_TAG].commit.hexsha
except IndexError:
raise Exception(f"BASE_GIT_TAG={BASE_GIT_TAG} is neither a tag nor a branch")
# not a branch either, try as a hexsha:
try:
# see if the sha1 exists in the repo
commit = git_repo.commit(BASE_GIT_TAG)
log.debug(f"Found commit '{commit}' for BASE_GIT_TAG={BASE_GIT_TAG}")
BASE_GIT_REVISION = BASE_GIT_TAG
except:
raise Exception(f"BASE_GIT_TAG={BASE_GIT_TAG} is neither a tag nor a branch nor a SHA1")

log.debug(f"Found BASE_GIT_REVISION={BASE_GIT_REVISION} for BASE_GIT_TAG={BASE_GIT_TAG}")

Expand Down