From e7dec7d0eecc362f02418820a146735a68430fbd Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 27 Mar 2024 19:52:17 -0400 Subject: [PATCH] Have the deprecated Diff.renamed property issue a warning --- git/diff.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git/diff.py b/git/diff.py index 0e39fe7a8..f89b12d98 100644 --- a/git/diff.py +++ b/git/diff.py @@ -7,6 +7,7 @@ import enum import re +import warnings from git.cmd import handle_process_output from git.compat import defenc @@ -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