◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
2 changes: 1 addition & 1 deletion git/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def iter_change_type(self, change_type: Lit_change_type) -> Iterator[T_Diff]:
yield diffidx
elif change_type == "C" and diffidx.copied_file:
yield diffidx
elif change_type == "R" and diffidx.renamed:
yield diffidx
elif change_type == "M" and diffidx.a_blob and diffidx.b_blob and diffidx.a_blob != diffidx.b_blob:
yield diffidx
Expand Down
15 changes: 14 additions & 1 deletion test/deprecation/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if TYPE_CHECKING:
from pathlib import Path

from git.diff import Diff
from git.objects.commit import Commit

# ------------------------------------------------------------------------
Expand All @@ -54,6 +54,12 @@ def diff(commit: "Commit") -> Generator["Diff", None, None]:
yield diff


def test_diff_renamed_warns(diff: "Diff") -> None:
"""The deprecated Diff.renamed property issues a deprecation warning."""
with pytest.deprecated_call():
Expand Down Expand Up @@ -122,3 +128,10 @@ def test_iterable_obj_inheriting_does_not_warn() -> None:

class Derived(IterableObj):
pass
Toggle all file notes Toggle all file annotations