From 9102f8602973a9dda944f59f5e17223bcb95fc54 Mon Sep 17 00:00:00 2001 From: Harsh Vora Date: Mon, 14 Nov 2022 14:16:31 -0800 Subject: [PATCH] Edkrepo: Enable using Tags in parent_sha of patchsets - Checked whether the parent_sha is in the tag list. If yes, checkout tags/ otherwise normal checkout Signed-off-by: Harsh Vora harsh.vora@intel.com Reviewed-by: Ashley DeSimone Reviewed-by: Kevin Sun Reviewed-by: Nate DeSimone --- edkrepo/common/common_repo_functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/common_repo_functions.py index 527f338..81aeaa0 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -822,7 +822,10 @@ def create_local_branch(name, patchset, global_manifest_path, manifest_obj, repo parent_patchset = manifest_obj.get_patchset(patchset.parent_sha, patchset.remote) repo.git.checkout(parent_patchset[2], b=name) except: - repo.git.checkout(patchset.parent_sha, b=name) + if patchset.parent_sha in repo.tags: + repo.git.checkout("tags/{}".format(patchset.parent_sha), b=name) + else: + repo.git.checkout(patchset.parent_sha, b=name) try: apply_patchset_operations(repo, remote, operations_list, global_manifest_path, remote_list) head_sha = repo.git.execute(['git', 'rev-parse', 'HEAD'])