MCPcopy
hub / github.com/cli/cli / setRepoDir

Method setRepoDir

git/command.go:67–84  ·  view source on GitHub ↗
(repoDir string)

Source from the content-addressed store, hash-verified

65}
66
67func (gc *Command) setRepoDir(repoDir string) {
68 for i, arg := range gc.Args {
69 if arg == "-C" {
70 gc.Args[i+1] = repoDir
71 return
72 }
73 }
74 // Handle "--" invocations for testing purposes.
75 var index int
76 for i, arg := range gc.Args {
77 if arg == "--" {
78 index = i + 1
79 }
80 }
81 gc.Args = append(gc.Args[:index+3], gc.Args[index+1:]...)
82 gc.Args[index+1] = "-C"
83 gc.Args[index+2] = repoDir
84}
85
86// Allow individual commands to be modified from the default client options.
87type CommandModifier func(*Command)

Callers 1

WithRepoDirFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected