Skip to content

Commit 4aa8157

Browse files
CopilotByron
andauthored
Refine trailer encoding review follow-up
Agent-Logs-Url: https://github.com/gitpython-developers/GitPython/sessions/519084d5-d5e2-4486-a9cc-5c258e596e13 Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
1 parent 34ec40d commit 4aa8157

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/test_commit.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,14 @@ def test_trailers_list_with_non_utf8_message_bytes(self, rw_dir):
667667
trailers={"Reviewed-by": "André <andre@example.com>"},
668668
)
669669

670-
commit.message = commit.message.encode(commit.encoding)
670+
bytes_commit = Commit(
671+
rw_repo,
672+
commit.binsha,
673+
message=commit.message.encode(commit.encoding),
674+
encoding=commit.encoding,
675+
)
671676

672-
assert commit.trailers_list == [("Reviewed-by", "André <andre@example.com>")]
677+
assert bytes_commit.trailers_list == [("Reviewed-by", "André <andre@example.com>")]
673678

674679
@with_rw_directory
675680
def test_index_commit_with_trailers(self, rw_dir):

0 commit comments

Comments
 (0)