Skip to content

Commit e7dec7d

Browse files
committed
Have the deprecated Diff.renamed property issue a warning
1 parent 2382891 commit e7dec7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎git/diff.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
importenum
99
importre
10+
importwarnings
1011

1112
fromgit.cmdimporthandle_process_output
1213
fromgit.compatimportdefenc
@@ -554,6 +555,11 @@ def renamed(self) -> bool:
554555
This property is deprecated.
555556
Please use the :attr:`renamed_file` property instead.
556557
"""
558+
warnings.warn(
559+
"Diff.renamed is deprecated, use Diff.renamed_file instead",
560+
DeprecationWarning,
561+
stacklevel=2,
562+
)
557563
returnself.renamed_file
558564

559565
@property

0 commit comments

Comments
(0)