Skip to content

Commit 4da170c

Browse files
Use configured git executable and finalize process for trailer creation
1 parent 7c5fbc6 commit 4da170c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git/objects/commit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,15 @@ def create_from_tree(
699699
trailer_args.append("--trailer")
700700
trailer_args.append(f"{key}: {val}")
701701

702-
cmd = ["git", "interpret-trailers"] + trailer_args
702+
cmd = [repo.git.GIT_PYTHON_GIT_EXECUTABLE, "interpret-trailers"] + trailer_args
703703
proc: Git.AutoInterrupt = repo.git.execute( # type: ignore[call-overload]
704704
cmd,
705705
as_process=True,
706706
istream=PIPE,
707707
)
708-
message = proc.communicate(str(message).encode())[0].decode("utf8")
708+
stdout_bytes, _ = proc.communicate(str(message).encode())
709+
finalize_process(proc)
710+
message = stdout_bytes.decode("utf8")
709711
# END apply trailers
710712

711713
# CREATE NEW COMMIT

0 commit comments

Comments
 (0)