(stdout: string)
| 77 | |
| 78 | // Exported for testing purposes |
| 79 | export function parseGitCommitId(stdout: string): string | undefined { |
| 80 | // git commit output: [branch abc1234] message |
| 81 | // or for root commit: [branch (root-commit) abc1234] message |
| 82 | const match = stdout.match(/\[[\w./-]+(?: \(root-commit\))? ([0-9a-f]+)\]/) |
| 83 | return match?.[1] |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Parse branch name from git push output. Push writes progress to stderr but |
no outgoing calls
no test coverage detected