summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2022-09-01 07:59:02 +0800
committerGitHub <noreply@github.com>2022-09-01 07:59:02 +0800
commitbec61576ae75803bc4e60d8de7a629c194313d1c (patch)
tree087efdcdb3fc02be8a4bdd77e5dc6880c3170e6a /git/repo/base.py
parent73bde1f27711e48bd887b5a13cd5e3a0a8d9d723 (diff)
parent18a79d8028f934f8f78da33de3b0523fc7d1df47 (diff)
downloadgitpython-bec61576ae75803bc4e60d8de7a629c194313d1c.tar.gz
Merge pull request #1485 from thehale/blame/rev-opts
feat(blame): Support custom `rev_opts` for blame
Diffstat (limited to 'git/repo/base.py')
-rw-r--r--git/repo/base.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index a1be5ff9..c49c6118 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -950,7 +950,12 @@ class Repo(object):
)
def blame(
- self, rev: Union[str, HEAD], file: str, incremental: bool = False, **kwargs: Any
+ self,
+ rev: Union[str, HEAD],
+ file: str,
+ incremental: bool = False,
+ rev_opts: Optional[List[str]] = None,
+ **kwargs: Any
) -> List[List[Commit | List[str | bytes] | None]] | Iterator[BlameEntry] | None:
"""The blame information for the given file at the given revision.
@@ -962,8 +967,8 @@ class Repo(object):
of appearance."""
if incremental:
return self.blame_incremental(rev, file, **kwargs)
-
- data: bytes = self.git.blame(rev, "--", file, p=True, stdout_as_string=False, **kwargs)
+ rev_opts = rev_opts or []
+ data: bytes = self.git.blame(rev, *rev_opts, "--", file, p=True, stdout_as_string=False, **kwargs)
commits: Dict[str, Commit] = {}
blames: List[List[Commit | List[str | bytes] | None]] = []