1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2025-01-10 17:32:05 +05:30

git_commit_simulator.py: fix extra newline for single-line messages

This commit is contained in:
パチュリー・ノーレッジ 2024-03-10 10:57:39 +03:00
parent 0957b5dc49
commit dc7e42dd73
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -41,7 +41,7 @@ def commit(*, commit_message: Union[List[str], str], branch_name: str = "main",
old_content: str = None, new_content: str, file: str, name: str, old_content: str = None, new_content: str, file: str, name: str,
email: str, mode: str = "100644", dt: datetime = None) -> str: email: str, mode: str = "100644", dt: datetime = None) -> str:
if isinstance(commit_message, str): if isinstance(commit_message, str):
commit_message = [commit_message + "\n"] commit_message = [commit_message]
commit_message = [" " * 4 + line if line else "" for line in commit_message] commit_message = [" " * 4 + line if line else "" for line in commit_message]
if len(commit_message) > 1: if len(commit_message) > 1:
commit_message.insert(1, "") commit_message.insert(1, "")