@@ -75,12 +75,12 @@ func Init(ctx context.Context, path string, opts ...InitOptions) error {
7575 }
7676
7777 args := []string {"init" }
78- args = append (args , opt .CommandOptions . Args ... )
78+ args = append (args , opt .Args ... )
7979 if opt .Bare {
8080 args = append (args , "--bare" )
8181 }
8282 args = append (args , "--end-of-options" )
83- _ , err = gitRun (ctx , path , args , opt .CommandOptions . Envs )
83+ _ , err = gitRun (ctx , path , args , opt .Envs )
8484 return err
8585}
8686
@@ -133,7 +133,7 @@ func Clone(ctx context.Context, url, dst string, opts ...CloneOptions) error {
133133 }
134134
135135 args := []string {"clone" }
136- args = append (args , opt .CommandOptions . Args ... )
136+ args = append (args , opt .Args ... )
137137 if opt .Mirror {
138138 args = append (args , "--mirror" )
139139 }
@@ -151,7 +151,7 @@ func Clone(ctx context.Context, url, dst string, opts ...CloneOptions) error {
151151 }
152152
153153 args = append (args , "--end-of-options" , url , dst )
154- _ , err = gitRun (ctx , "" , args , opt .CommandOptions . Envs )
154+ _ , err = gitRun (ctx , "" , args , opt .Envs )
155155 return err
156156}
157157
@@ -173,12 +173,12 @@ func (r *Repository) Fetch(ctx context.Context, opts ...FetchOptions) error {
173173 }
174174
175175 args := []string {"fetch" }
176- args = append (args , opt .CommandOptions . Args ... )
176+ args = append (args , opt .Args ... )
177177 if opt .Prune {
178178 args = append (args , "--prune" )
179179 }
180180
181- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
181+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
182182 return err
183183}
184184
@@ -206,7 +206,7 @@ func (r *Repository) Pull(ctx context.Context, opts ...PullOptions) error {
206206 }
207207
208208 args := []string {"pull" }
209- args = append (args , opt .CommandOptions . Args ... )
209+ args = append (args , opt .Args ... )
210210 if opt .Rebase {
211211 args = append (args , "--rebase" )
212212 }
@@ -220,7 +220,7 @@ func (r *Repository) Pull(ctx context.Context, opts ...PullOptions) error {
220220 }
221221 }
222222
223- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
223+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
224224 return err
225225}
226226
@@ -240,9 +240,9 @@ func (r *Repository) Push(ctx context.Context, remote, branch string, opts ...Pu
240240 }
241241
242242 args := []string {"push" }
243- args = append (args , opt .CommandOptions . Args ... )
243+ args = append (args , opt .Args ... )
244244 args = append (args , "--end-of-options" , remote , branch )
245- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
245+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
246246 return err
247247}
248248
@@ -264,7 +264,7 @@ func (r *Repository) Checkout(ctx context.Context, branch string, opts ...Checko
264264 }
265265
266266 args := []string {"checkout" }
267- args = append (args , opt .CommandOptions . Args ... )
267+ args = append (args , opt .Args ... )
268268 if opt .BaseBranch != "" {
269269 args = append (args , "-b" )
270270 }
@@ -273,7 +273,7 @@ func (r *Repository) Checkout(ctx context.Context, branch string, opts ...Checko
273273 args = append (args , opt .BaseBranch )
274274 }
275275
276- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
276+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
277277 return err
278278}
279279
@@ -298,10 +298,10 @@ func (r *Repository) Reset(ctx context.Context, rev string, opts ...ResetOptions
298298 if opt .Hard {
299299 args = append (args , "--hard" )
300300 }
301- args = append (args , opt .CommandOptions . Args ... )
301+ args = append (args , opt .Args ... )
302302 args = append (args , "--end-of-options" , rev )
303303
304- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
304+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
305305 return err
306306}
307307
@@ -323,9 +323,9 @@ func (r *Repository) Move(ctx context.Context, src, dst string, opts ...MoveOpti
323323 }
324324
325325 args := []string {"mv" }
326- args = append (args , opt .CommandOptions . Args ... )
326+ args = append (args , opt .Args ... )
327327 args = append (args , "--end-of-options" , src , dst )
328- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
328+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
329329 return err
330330}
331331
@@ -349,15 +349,15 @@ func (r *Repository) Add(ctx context.Context, opts ...AddOptions) error {
349349 }
350350
351351 args := []string {"add" }
352- args = append (args , opt .CommandOptions . Args ... )
352+ args = append (args , opt .Args ... )
353353 if opt .All {
354354 args = append (args , "--all" )
355355 }
356356 if len (opt .Pathspecs ) > 0 {
357357 args = append (args , "--" )
358358 args = append (args , opt .Pathspecs ... )
359359 }
360- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
360+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
361361 return err
362362}
363363
@@ -380,7 +380,7 @@ func (r *Repository) Commit(ctx context.Context, committer *Signature, message s
380380 }
381381
382382 envs := committerEnvs (committer )
383- envs = append (envs , opt .CommandOptions . Envs ... )
383+ envs = append (envs , opt .Envs ... )
384384
385385 if opt .Author == nil {
386386 opt .Author = committer
@@ -389,7 +389,7 @@ func (r *Repository) Commit(ctx context.Context, committer *Signature, message s
389389 args := []string {"commit" }
390390 args = append (args , fmt .Sprintf ("--author='%s <%s>'" , opt .Author .Name , opt .Author .Email ))
391391 args = append (args , "-m" , message )
392- args = append (args , opt .CommandOptions . Args ... )
392+ args = append (args , opt .Args ... )
393393
394394 _ , err := gitRun (ctx , r .path , args , envs )
395395 // No stderr but exit status 1 means nothing to commit.
@@ -445,11 +445,11 @@ func (r *Repository) ShowNameStatus(ctx context.Context, rev string, opts ...Sho
445445 }()
446446
447447 args := []string {"show" , "--name-status" , "--pretty=format:''" }
448- args = append (args , opt .CommandOptions . Args ... )
448+ args = append (args , opt .Args ... )
449449 args = append (args , "--end-of-options" , rev )
450450
451451 stderr := new (bytes.Buffer )
452- err := gitPipeline (ctx , r .path , args , opt .CommandOptions . Envs , w , stderr , nil )
452+ err := gitPipeline (ctx , r .path , args , opt .Envs , w , stderr , nil )
453453 _ = w .Close () // Close writer to exit parsing goroutine
454454 if err != nil {
455455 return nil , concatenateError (err , stderr .String ())
@@ -476,10 +476,10 @@ func (r *Repository) RevParse(ctx context.Context, rev string, opts ...RevParseO
476476 }
477477
478478 args := []string {"rev-parse" }
479- args = append (args , opt .CommandOptions . Args ... )
479+ args = append (args , opt .Args ... )
480480 args = append (args , rev )
481481
482- commitID , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
482+ commitID , err := gitRun (ctx , r .path , args , opt .Envs )
483483 if err != nil {
484484 if strings .Contains (err .Error (), "exit status 128" ) {
485485 return "" , ErrRevisionNotExist
@@ -517,9 +517,9 @@ func (r *Repository) CountObjects(ctx context.Context, opts ...CountObjectsOptio
517517 }
518518
519519 args := []string {"count-objects" , "-v" }
520- args = append (args , opt .CommandOptions . Args ... )
520+ args = append (args , opt .Args ... )
521521
522- stdout , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
522+ stdout , err := gitRun (ctx , r .path , args , opt .Envs )
523523 if err != nil {
524524 return nil , err
525525 }
@@ -571,7 +571,7 @@ func (r *Repository) Fsck(ctx context.Context, opts ...FsckOptions) error {
571571 }
572572
573573 args := []string {"fsck" }
574- args = append (args , opt .CommandOptions . Args ... )
575- _ , err := gitRun (ctx , r .path , args , opt .CommandOptions . Envs )
574+ args = append (args , opt .Args ... )
575+ _ , err := gitRun (ctx , r .path , args , opt .Envs )
576576 return err
577577}
0 commit comments