* Parse branch name from git push output. Push writes progress to stderr but * the ref update line ("abc..def branch -> branch", "* [new branch] * branch -> branch", or " + abc...def branch -> branch (forced update)") is * the signal. Works on either stdout or stderr. Git prefixes each ref line
(output: string)
| 91 | * with a status flag (space, +, -, *, !, =); the char class tolerates any. |
| 92 | */ |
| 93 | function parseGitPushBranch(output: string): string | undefined { |
| 94 | const match = output.match( |
| 95 | /^\s*[+\-*!= ]?\s*(?:\[new branch\]|\S+\.\.+\S+)\s+\S+\s*->\s*(\S+)/m, |
| 96 | ) |
| 97 | return match?.[1] |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * gh pr merge/close/ready print "✓ <Verb> pull request owner/repo#1234" with |
no outgoing calls
no test coverage detected