MCPcopy
hub / github.com/cli/cli / setPrepareCmd

Function setPrepareCmd

internal/run/stub.go:53–65  ·  view source on GitHub ↗
(fn func(*exec.Cmd) Runnable)

Source from the content-addressed store, hash-verified

51}
52
53func setPrepareCmd(fn func(*exec.Cmd) Runnable) func() {
54 origPrepare := PrepareCmd
55 PrepareCmd = func(cmd *exec.Cmd) Runnable {
56 // normalize git executable name for consistency in tests
57 if baseName := filepath.Base(cmd.Args[0]); baseName == "git" || baseName == "git.exe" {
58 cmd.Args[0] = "git"
59 }
60 return fn(cmd)
61 }
62 return func() {
63 PrepareCmd = origPrepare
64 }
65}
66
67// CommandStubber stubs out invocations to external commands.
68type CommandStubber struct {

Callers 1

StubFunction · 0.85

Calls 1

BaseMethod · 0.80

Tested by

no test coverage detected