diff options
author | Twist <itsluketwist@gmail.com> | 2023-04-23 14:16:53 +0100 |
---|---|---|
committer | Twist <itsluketwist@gmail.com> | 2023-04-23 14:16:53 +0100 |
commit | 9ef07a731caf39684891bce5cc92c4e91829138d (patch) | |
tree | a1adfd6a7fa392cb39b16865caea7e6aef70666c /git/objects/commit.py | |
parent | ed36bd903e1fdf45c53b52dbcb1b2d8444965d98 (diff) | |
download | gitpython-9ef07a731caf39684891bce5cc92c4e91829138d.tar.gz |
Revert the removal of Commit.trailers property.
Diffstat (limited to 'git/objects/commit.py')
-rw-r--r-- | git/objects/commit.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py index f164becb..138db0af 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -336,6 +336,20 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable): return Stats._list_from_string(self.repo, text) @property + def trailers(self) -> Dict[str, str]: + """Get the trailers of the message as a dictionary + + :note: This property is deprecated, please use either ``Commit.trailers_list`` or ``Commit.trailers_dict``. + + :return: + Dictionary containing whitespace stripped trailer information. + Only contains the latest instance of each trailer key. + """ + return { + k: v[0] for k, v in self.trailers_dict.items() + } + + @property def trailers_list(self) -> List[Tuple[str, str]]: """Get the trailers of the message as a list |