mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-01-10 08:27:48 +05:30
git_commit_simulator.py: fix extra newline for single-line messages
This commit is contained in:
parent
0957b5dc49
commit
dc7e42dd73
@ -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,
|
||||
email: str, mode: str = "100644", dt: datetime = None) -> 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]
|
||||
if len(commit_message) > 1:
|
||||
commit_message.insert(1, "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user