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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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, "")
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ func (p *FlatPrinter) Print(repos []Printable) string {
|
||||
|
||||
if len(repo.Errors()) > 0 {
|
||||
str.WriteString(" " + red("error") + "\n")
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ func (n *Node) isYoungest() bool {
|
||||
for i, sis := range sisters {
|
||||
if sis.val == n.val {
|
||||
myIndex = i
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user