Skip to content

Commit

Permalink
fix: Declare error variable and use assignment for spinner (#40)
Browse files Browse the repository at this point in the history
Thanks to @mgudemann
  • Loading branch information
mgudemann authored Dec 10, 2024
1 parent e5b720f commit 546f07f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ func clone(localpath, branch, cloneurl string, auth ssh.AuthMethod, force bool,
}

var spinner *yacspin.Spinner
var err error

if !noSpinner {
spinner, err := yacspin.New(cfg)
spinner, err = yacspin.New(cfg)
if err != nil {
log.Debug().Err(err).Msg("cannot create spinner")
}
Expand Down Expand Up @@ -97,7 +98,7 @@ func clone(localpath, branch, cloneurl string, auth ssh.AuthMethod, force bool,
}
}

_, err := git.PlainClone(localpath, false, &git.CloneOptions{
_, err = git.PlainClone(localpath, false, &git.CloneOptions{
Auth: auth,
URL: cloneurl,
ReferenceName: plumbing.ReferenceName("refs/heads/" + branch),
Expand Down

0 comments on commit 546f07f

Please sign in to comment.