MCPcopy Create free account
hub / github.com/cli/cli / setRepoDir

Method setRepoDir

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

Source from the content-addressed store, hash-verified

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

Callers 1

WithRepoDirFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected