Skip to content

Commit

Permalink
fix(git): skips empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Dec 18, 2024
1 parent 5ecb99c commit 04a4852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function log(sha: string, { stdout = "", ...options } = {} as LogOptions)
}
// Parse entries
let entries = []
for (const line of stdout.trim().split("\n")) {
for (const line of stdout.trim().split("\n").filter(Boolean)) {
try {
const { sha, author, time, summary } = line.match(/^<<(?<sha>.{40})>> <<(?<time>\d+)>> <<(?<author>.*)>> (?<summary>.*)$/)!.groups!
const match = summary.match(/^(?<type>[^\(\):]+)(?:\((?<scopes>[^\(\):]+)\))?(?<breaking>!?):\s+(?<subject>[\s\S]*)/)?.groups
Expand Down

0 comments on commit 04a4852

Please sign in to comment.