mirror of
https://github.com/grdl/git-get.git
synced 2026-02-10 02:04:20 +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)
|
gitPath := filepath.Join(path, dotgit)
|
||||||
if _, err := os.Stat(gitPath); err == nil {
|
if _, err := os.Stat(gitPath); err == nil {
|
||||||
f.addIfOk(path)
|
f.addIfOk(path)
|
||||||
|
|
||||||
return fs.SkipDir // Skip this directory's contents since it's a repo
|
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 {
|
if err != nil {
|
||||||
cleanupFailedClone(opts.Path)
|
cleanupFailedClone(opts.Path)
|
||||||
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ func Clone(opts *CloneOpts) (*Repo, error) {
|
|||||||
// Fetch preforms a git fetch on all remotes.
|
// Fetch preforms a git fetch on all remotes.
|
||||||
func (r *Repo) Fetch() error {
|
func (r *Repo) Fetch() error {
|
||||||
err := run.Git("fetch", "--all").OnRepo(r.path).AndShutUp()
|
err := run.Git("fetch", "--all").OnRepo(r.path).AndShutUp()
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ func (r *Repo) loadBranches() (map[string]string, []error) {
|
|||||||
branches, err := r.Branches()
|
branches, err := r.Branches()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors = append(errors, err)
|
errors = append(errors, err)
|
||||||
|
|
||||||
return statuses, errors
|
return statuses, errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ func (r *Repo) Path() string {
|
|||||||
// RepoEmpty creates an empty git repo.
|
// RepoEmpty creates an empty git repo.
|
||||||
func RepoEmpty(t *testing.T) *Repo {
|
func RepoEmpty(t *testing.T) *Repo {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
return RepoEmptyInDir(t, "")
|
return RepoEmptyInDir(t, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ func (p *FlatPrinter) Print(repos []Printable) string {
|
|||||||
|
|
||||||
if len(repo.Errors()) > 0 {
|
if len(repo.Errors()) > 0 {
|
||||||
str.WriteString(" " + red("error") + "\n")
|
str.WriteString(" " + red("error") + "\n")
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ func (n *Node) isYoungest() bool {
|
|||||||
for i, sis := range sisters {
|
for i, sis := range sisters {
|
||||||
if sis.val == n.val {
|
if sis.val == n.val {
|
||||||
myIndex = i
|
myIndex = i
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,5 +133,6 @@ func (e GitError) Error() string {
|
|||||||
|
|
||||||
func lines(output []byte) []string {
|
func lines(output []byte) []string {
|
||||||
lines := strings.TrimSuffix(string(output), "\n")
|
lines := strings.TrimSuffix(string(output), "\n")
|
||||||
|
|
||||||
return strings.Split(lines, "\n")
|
return strings.Split(lines, "\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user