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

Function parseGitCommitId

src/tools/shared/gitOperationTracking.ts:79–84  ·  view source on GitHub ↗
(stdout: string)

Source from the content-addressed store, hash-verified

77
78// Exported for testing purposes
79export 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

Callers 2

detectGitOperationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected