File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -119,20 +119,13 @@ func NewGitCLI(opts ...Option) *GitCLI {
119
119
// New returns a new git client with the same config as the current one, but
120
120
// with the given options applied on top.
121
121
func (cli * GitCLI ) New (opts ... Option ) * GitCLI {
122
- c := & GitCLI {
123
- git : cli .git ,
124
- dir : cli .dir ,
125
- workTree : cli .workTree ,
126
- gitDir : cli .gitDir ,
127
- args : append ([]string {}, cli .args ... ),
128
- streams : cli .streams ,
129
- sshAuthSock : cli .sshAuthSock ,
130
- sshKnownHosts : cli .sshKnownHosts ,
131
- }
122
+ clone := * cli
123
+ clone .args = append ([]string {}, cli .args ... )
124
+
132
125
for _ , opt := range opts {
133
- opt (c )
126
+ opt (& clone )
134
127
}
135
- return c
128
+ return & clone
136
129
}
137
130
138
131
// Run executes a git command with the given args.
You can’t perform that action at this time.
0 commit comments