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

Function parsePrNumberFromText

src/tools/shared/gitOperationTracking.ts:104–107  ·  view source on GitHub ↗

* gh pr merge/close/ready print "✓ pull request owner/repo#1234" with * no URL. Extract the PR number from the text.

(stdout: string)

Source from the content-addressed store, hash-verified

102 * no URL. Extract the PR number from the text.
103 */
104function parsePrNumberFromText(stdout: string): number | undefined {
105 const match = stdout.match(/[Pp]ull request (?:\S+#)?#?(\d+)/)
106 return match?.[1] ? parseInt(match[1], 10) : undefined
107}
108
109/**
110 * Extract target ref from `git merge <ref>` / `git rebase <ref>` command.

Callers 1

detectGitOperationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected