MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseGitPushBranch

Function parseGitPushBranch

src/tools/shared/gitOperationTracking.ts:93–98  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

91 * with a status flag (space, +, -, *, !, =); the char class tolerates any.
92 */
93function 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

Callers 1

detectGitOperationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected