From a5afb75c6dcadeb22bb24d931170766f7af4c58c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 7 May 2025 18:06:52 +0200 Subject: patman: Allow setting a git directory when sending Support specifying the git-directory when creating and sending patches. This will allow better testing of this functionality, since we can use a test directory. For count_commits_to_branch() support an end commit while we are here. Signed-off-by: Simon Glass --- tools/patman/patchstream.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tools/patman/patchstream.py') diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 3ec06a6b5f5..5691ee4b3c1 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -754,7 +754,7 @@ def get_metadata_for_list(commit_range, git_dir=None, count=None, pst.finalise() return series -def get_metadata(branch, start, count): +def get_metadata(branch, start, count, git_dir=None): """Reads out patch series metadata from the commits This does a 'git log' on the relevant commits and pulls out the tags we @@ -769,8 +769,9 @@ def get_metadata(branch, start, count): Series: Object containing information about the commits. """ top = f"{branch if branch else 'HEAD'}~{start}" - series = get_metadata_for_list(top, None, count) - series.base_commit = commit.Commit(gitutil.get_hash(f'{top}~{count}')) + series = get_metadata_for_list(top, git_dir, count) + series.base_commit = commit.Commit( + gitutil.get_hash(f'{top}~{count}', git_dir)) series.branch = branch or gitutil.get_branch() series.top = top return series -- cgit v1.2.3