From 546f07f3ccd946d566a5c7da9859b272db92148d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20G=C3=BCdemann?= Date: Tue, 10 Dec 2024 08:01:34 +0100 Subject: [PATCH] fix: Declare error variable and use assignment for spinner (#40) Thanks to @mgudemann --- git/clone.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git/clone.go b/git/clone.go index ce7c9af..edd4d89 100644 --- a/git/clone.go +++ b/git/clone.go @@ -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") } @@ -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),