Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78424b5

Browse files
committed
Deprecate Commit.trailers.
1 parentd2f7284 commit78424b5

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

‎git/objects/commit.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -335,24 +335,6 @@ def stats(self) -> Stats:
335335
text=self.repo.git.diff(self.parents[0].hexsha,self.hexsha,"--",numstat=True,no_renames=True)
336336
returnStats._list_from_string(self.repo,text)
337337

338-
@property
339-
deftrailers(self)->Dict[str,str]:
340-
"""Get the trailers of the message as a dictionary
341-
342-
Git messages can contain trailer information that are similar to RFC 822
343-
e-mail headers (see: https://git-scm.com/docs/git-interpret-trailers).
344-
345-
WARNING: This function only returns the latest instance of each trailer key
346-
and will be deprecated soon. Please see either ``Commit.trailers_list`` or ``Commit.trailers_dict``.
347-
348-
:return:
349-
Dictionary containing whitespace stripped trailer information.
350-
Only the latest instance of each trailer key.
351-
"""
352-
return {
353-
k:v[0]fork,vinself.trailers_dict.items()
354-
}
355-
356338
@property
357339
deftrailers_list(self)->List[str]:
358340
"""Get the trailers of the message as a list

‎test/test_commit.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,6 @@ def test_trailers(self):
523523
KEY_1: [VALUE_1_1,VALUE_1_2],
524524
KEY_2: [VALUE_2],
525525
}
526-
assertcommit.trailers== {
527-
KEY_1:VALUE_1_1,
528-
KEY_2:VALUE_2,
529-
}
530526

531527
# check that trailer stays empty for multiple msg combinations
532528
msgs= [
@@ -543,14 +539,12 @@ def test_trailers(self):
543539
commit.message=msg
544540
assertcommit.trailers_list== []
545541
assertcommit.trailers_dict== {}
546-
assertcommit.trailers== {}
547542

548543
# check that only the last key value paragraph is evaluated
549544
commit=copy.copy(self.rorepo.commit("master"))
550545
commit.message=f"Subject\n\nMultiline\nBody\n\n{KEY_1}:{VALUE_1_1}\n\n{KEY_2}:{VALUE_2}\n"
551546
assertcommit.trailers_list== [f"{KEY_2}:{VALUE_2}"]
552547
assertcommit.trailers_dict== {KEY_2: [VALUE_2]}
553-
assertcommit.trailers== {KEY_2:VALUE_2}
554548

555549
deftest_commit_co_authors(self):
556550
commit=copy.copy(self.rorepo.commit("4251bd5"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp