(s: string)
| 723 | } |
| 724 | |
| 725 | function parseAuthorString(s: string): { name: string; email: string } | undefined { |
| 726 | // `Name <email@host>` — the same shape `git -c user.email=...` |
| 727 | // and `--author` accept. Anything else is rejected; the CLI |
| 728 | // shouldn't silently drop the email half. |
| 729 | const m = /^(.+?)\s*<([^<>]+)>\s*$/.exec(s); |
| 730 | if (!m) return undefined; |
| 731 | return { name: m[1].trim(), email: m[2].trim() }; |
| 732 | } |
| 733 | |
| 734 | function firstLine(s: string): string { |
| 735 | const i = s.indexOf("\n"); |