mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-09-11 12:25:42 +03:00
Improve commit message parsing
Refactor the parsing of commit messages in the `+page.svelte` file to trim unnecessary whitespace from the summary and description fields. This change makes sure the processed commit message is more readable and concise. Changes: - Trim the summary and description lines after slicing the message
This commit is contained in:
parent
929e008811
commit
e9405f9342
@ -70,8 +70,8 @@
|
||||
})
|
||||
.then(({ message }) => {
|
||||
const firstNewLine = message.indexOf('\n');
|
||||
summary = firstNewLine > -1 ? message.slice(0, firstNewLine) : message;
|
||||
description = firstNewLine > -1 ? message.slice(firstNewLine + 1) : '';
|
||||
summary = firstNewLine > -1 ? message.slice(0, firstNewLine).trim() : message;
|
||||
description = firstNewLine > -1 ? message.slice(firstNewLine + 1).trim() : '';
|
||||
})
|
||||
.catch(() => {
|
||||
error('Failed to generate commit message');
|
||||
|
Loading…
Reference in New Issue
Block a user