Skip to content

Commit 04a4852

Browse files
committed
fix(git): skips empty lines
1 parent 5ecb99c commit 04a4852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function log(sha: string, { stdout = "", ...options } = {} as LogOptions)
1212
}
1313
// Parse entries
1414
let entries = []
15-
for (const line of stdout.trim().split("\n")) {
15+
for (const line of stdout.trim().split("\n").filter(Boolean)) {
1616
try {
1717
const { sha, author, time, summary } = line.match(/^<<(?<sha>.{40})>> <<(?<time>\d+)>> <<(?<author>.*)>> (?<summary>.*)$/)!.groups!
1818
const match = summary.match(/^(?<type>[^\(\):]+)(?:\((?<scopes>[^\(\):]+)\))?(?<breaking>!?):\s+(?<subject>[\s\S]*)/)?.groups

0 commit comments

Comments
 (0)