6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 15:04:44 +00:00

Fix issues found by nlreturn linter

This commit is contained in:
Grzegorz Dlugoszewski
2025-08-24 18:28:09 +02:00
parent 3b85a64c2d
commit ca8681f997
7 changed files with 8 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ func (f *RepoFinder) Find() error {
gitPath := filepath.Join(path, dotgit)
if _, err := os.Stat(gitPath); err == nil {
f.addIfOk(path)
return fs.SkipDir // Skip this directory's contents since it's a repo
}

View File

@@ -57,6 +57,7 @@ func Clone(opts *CloneOpts) (*Repo, error) {
if err != nil {
cleanupFailedClone(opts.Path)
return nil, err
}
@@ -68,6 +69,7 @@ func Clone(opts *CloneOpts) (*Repo, error) {
// Fetch preforms a git fetch on all remotes.
func (r *Repo) Fetch() error {
err := run.Git("fetch", "--all").OnRepo(r.path).AndShutUp()
return err
}

View File

@@ -65,6 +65,7 @@ func (r *Repo) loadBranches() (map[string]string, []error) {
branches, err := r.Branches()
if err != nil {
errors = append(errors, err)
return statuses, errors
}

View File

@@ -20,6 +20,7 @@ func (r *Repo) Path() string {
// RepoEmpty creates an empty git repo.
func RepoEmpty(t *testing.T) *Repo {
t.Helper()
return RepoEmptyInDir(t, "")
}

View File

@@ -23,6 +23,7 @@ func (p *FlatPrinter) Print(repos []Printable) string {
if len(repo.Errors()) > 0 {
str.WriteString(" " + red("error") + "\n")
continue
}

View File

@@ -216,6 +216,7 @@ func (n *Node) isYoungest() bool {
for i, sis := range sisters {
if sis.val == n.val {
myIndex = i
break
}
}

View File

@@ -133,5 +133,6 @@ func (e GitError) Error() string {
func lines(output []byte) []string {
lines := strings.TrimSuffix(string(output), "\n")
return strings.Split(lines, "\n")
}