Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions LoreQuickCommit/Source/LoreQuickCommit/Private/LoreClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,13 @@ FString FLoreClient::SanitizeMessage(const FString& Message)
// quotes so the argument stays well-formed.
FString Clean = Message;
Clean.ReplaceInline(TEXT("\""), TEXT("'"));
Clean.ReplaceInline(TEXT("\r"), TEXT(" "));
Clean.ReplaceInline(TEXT("\n"), TEXT(" "));
// Preserve line breaks so multi-line commit messages — a subject line plus a
// body and/or trailers such as "Closes: #123" — survive instead of being
// flattened to a single line. lore accepts a multi-line quoted message
// argument, and ExecProcess keeps newlines inside the quoted parameter.
// Normalise CRLF/CR to LF so the stored message uses one consistent ending.
Clean.ReplaceInline(TEXT("\r\n"), TEXT("\n"));
Clean.ReplaceInline(TEXT("\r"), TEXT("\n"));
if (Clean.IsEmpty())
{
Clean = TEXT("Update");
Expand Down