Skip to content

Commit

Permalink
Use trim and split util (#4339)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Jul 25, 2023
1 parent 182269f commit 623af67
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions extension/src/experiments/model/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ const collectCommitData = (
acc: { [sha: string]: CommitData },
commit: string
) => {
const [sha, author, date, refNamesWithKey] = commit
.split('\n')
.filter(Boolean)
const [sha, author, date, refNamesWithKey] = trimAndSplit(commit)

if (!sha) {
return
Expand Down Expand Up @@ -150,7 +148,7 @@ const formatCommitMessage = (commit: string | undefined) => {
if (!commit) {
return undefined
}
const lines = commit.split('\n').filter(Boolean)
const lines = trimAndSplit(commit)
return `${lines[0]}${lines.length > 1 ? ' ...' : ''}`
}

Expand Down

0 comments on commit 623af67

Please sign in to comment.