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

Function gitCmdRe

src/tools/shared/gitOperationTracking.ts:23–27  ·  view source on GitHub ↗

* Build a regex that matches `git ` while tolerating git's global * options between `git` and the subcommand (e.g. `-c key=val`, `-C path`, * `--git-dir=path`). Common when the model retries with * `git -c commit.gpgsign=false commit` after a signing failure.

(subcmd: string, suffix = '')

Source from the content-addressed store, hash-verified

21 * `git -c commit.gpgsign=false commit` after a signing failure.
22 */
23function gitCmdRe(subcmd: string, suffix = ''): RegExp {
24 return new RegExp(
25 `\\bgit(?:\\s+-[cC]\\s+\\S+|\\s+--\\S+=\\S+)*\\s+${subcmd}\\b${suffix}`,
26 )
27}
28
29const GIT_COMMIT_RE = gitCmdRe('commit')
30const GIT_PUSH_RE = gitCmdRe('push')

Callers 2

parseRefFromCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected