Merge pull request #521 from yashLadha/bug/issue_list_on_no_remote

Fix error when getting issue list with no git remotes

Fixes #465
This commit is contained in:
Mislav Marohnić 2020-02-20 22:35:35 +01:00 committed by GitHub
commit f9649ebddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,9 +201,17 @@ func (c *fsContext) Remotes() (Remotes, error) {
if err != nil {
return nil, err
}
if len(gitRemotes) == 0 {
return nil, errors.New("no git remotes found")
}
sshTranslate := git.ParseSSHConfig().Translator()
c.remotes = translateRemotes(gitRemotes, sshTranslate)
}
if len(c.remotes) == 0 {
return nil, errors.New("no git remote found for a github.com repository")
}
return c.remotes, nil
}