(fn func(*exec.Cmd) Runnable)
| 51 | } |
| 52 | |
| 53 | func 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. |
| 68 | type CommandStubber struct { |