Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 19647c8

Browse files
committedAug 31, 2022
Revert "feat(blame): Support custom rev_opts for blame"
This reverts commit 18a79d8.
1 parent 18a79d8 commit 19647c8

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed
 

‎AUTHORS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ Contributors are:
4949
-Julien Mauroy <pro.julien.mauroy _at_ gmail.com>
5050
-Patrick Gerard
5151
-Luke Twist <itsluketwist@gmail.com>
52-
-Joseph Hale <me _at_ jhale.dev>
5352
Portions derived from other open source works and are clearly marked.

‎git/repo/base.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -950,12 +950,7 @@ def blame_incremental(self, rev: str | HEAD, file: str, **kwargs: Any) -> Iterat
950950
)
951951

952952
def blame(
953-
self,
954-
rev: Union[str, HEAD],
955-
file: str,
956-
incremental: bool = False,
957-
rev_opts: Optional[List[str]] = None,
958-
**kwargs: Any
953+
self, rev: Union[str, HEAD], file: str, incremental: bool = False, **kwargs: Any
959954
) -> List[List[Commit | List[str | bytes] | None]] | Iterator[BlameEntry] | None:
960955
"""The blame information for the given file at the given revision.
961956
@@ -967,8 +962,8 @@ def blame(
967962
of appearance."""
968963
if incremental:
969964
return self.blame_incremental(rev, file, **kwargs)
970-
rev_opts = rev_opts or []
971-
data: bytes = self.git.blame(rev, *rev_opts, "--", file, p=True, stdout_as_string=False, **kwargs)
965+
966+
data: bytes = self.git.blame(rev, "--", file, p=True, stdout_as_string=False, **kwargs)
972967
commits: Dict[str, Commit] = {}
973968
blames: List[List[Commit | List[str | bytes] | None]] = []
974969

‎test/test_repo.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,6 @@ def test_blame_complex_revision(self, git):
553553
self.assertEqual(len(res), 1)
554554
self.assertEqual(len(res[0][1]), 83, "Unexpected amount of parsed blame lines")
555555

556-
@mock.patch.object(Git, "_call_process")
557-
def test_blame_accepts_rev_opts(self, git):
558-
res = self.rorepo.blame("HEAD", "README.md", rev_opts=["-M", "-C", "-C"])
559-
expected_args = ['blame', 'HEAD', '-M', '-C', '-C', '--', 'README.md']
560-
boilerplate_kwargs = {"p" : True, "stdout_as_string": False}
561-
git.assert_called_once_with(*expected_args, **boilerplate_kwargs)
562-
563556
@skipIf(
564557
HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
565558
"""FIXME: File "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute

0 commit comments

Comments
 (0)
Please sign in to comment.