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 <leif.lindholm@oss.qualcomm.com>
This commit is contained in:
Leif Lindholm
2025-06-10 12:56:14 +01:00
committed by mergify[bot]
parent fe19f86dcd
commit a2e20bc4b0

View File

@@ -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