From a2e20bc4b0dc4f88105d304dd99479fd4f1eaac0 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Tue, 10 Jun 2025 12:56:14 +0100 Subject: [PATCH] BaseTools/PatchCheck.py: make get_parent_packages return directory names The get_parent_packages function in CheckGitCommits returns the path of non-package directories, but in fact returns the path of the .dec file for actual packages. Align the handling to be more consistent and return only directory names, regarding of how it was found. Signed-off-by: Leif Lindholm --- BaseTools/Scripts/PatchCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index d178a6081b..551e0b4e53 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -730,7 +730,7 @@ class CheckGitCommits: for dec_file in dec_files: if os.path.commonpath([dec_file, file]): dec_found = True - parents.add(dec_file) + parents.add(dec_file.split('/')[0]) if not dec_found and os.path.dirname (file): # No DEC file found and file is in a subdir # Covers BaseTools, .github, .azurepipelines, .pytool