(commits: CommitView[])
| 810 | } |
| 811 | |
| 812 | function formatLogFull(commits: CommitView[]): string { |
| 813 | if (commits.length === 0) return ""; |
| 814 | const blocks: string[] = []; |
| 815 | for (const c of commits) { |
| 816 | const lines = [ |
| 817 | `commit ${c.oid}`, |
| 818 | `Author: ${c.author.name} <${c.author.email}>`, |
| 819 | `Date: ${formatGitTimestamp(c.author.timestamp, c.author.timezoneOffset)}`, |
| 820 | "", |
| 821 | ...c.message.split("\n").map((l) => ` ${l}`), |
| 822 | ]; |
| 823 | blocks.push(lines.join("\n")); |
| 824 | } |
| 825 | return `${blocks.join("\n\n")}\n`; |
| 826 | } |
| 827 | |
| 828 | function formatGitTimestamp(timestamp: number, timezoneOffset: number): string { |
| 829 | // isomorphic-git stores timezoneOffset as minutes east of UTC, |
no test coverage detected