Skip to content

Commit

Permalink
Have the deprecated Diff.renamed property issue a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
EliahKagan committed Mar 28, 2024
1 parent 2382891 commit e7dec7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions git/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import enum
import re
import warnings

from git.cmd import handle_process_output
from git.compat import defenc
Expand Down Expand Up @@ -554,6 +555,11 @@ def renamed(self) -> bool:
This property is deprecated.
Please use the :attr:`renamed_file` property instead.
"""
warnings.warn(
"Diff.renamed is deprecated, use Diff.renamed_file instead",
DeprecationWarning,
stacklevel=2,
)
return self.renamed_file

@property
Expand Down

0 comments on commit e7dec7d

Please sign in to comment.