Skip to content

Commit 3961dcb

Browse files
author
Gusted
committed
Avoid len()
1 parent 81d7346 commit 3961dcb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

modules/git/repo.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ type PushOptions struct {
197197

198198
// Push pushs local commits to given remote branch.
199199
func Push(ctx context.Context, repoPath string, opts PushOptions) error {
200-
initArgs := []string{}
201-
if len(opts.InitArgs) > 0 {
202-
initArgs = append(initArgs, opts.InitArgs...)
203-
}
200+
initArgs := opts.InitArgs
204201
initArgs = append(initArgs, "push")
205202

206203
cmd := NewCommand(ctx, initArgs...)

0 commit comments

Comments
 (0)