From 4ee995dafdf98730c292c63c1b8a0fab5f2198d1 Mon Sep 17 00:00:00 2001 From: Yash Ladha Date: Fri, 21 Feb 2020 02:12:58 +0530 Subject: [PATCH 1/2] fix(486): Getting issue list on no remotes specified Fixes: #486 --- context/context.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/context/context.go b/context/context.go index fed589a8d..a877b2053 100644 --- a/context/context.go +++ b/context/context.go @@ -201,6 +201,10 @@ 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) } From 4727fc465982d3029324fc5b77ee37e28c29a2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 20 Feb 2020 22:28:46 +0100 Subject: [PATCH 2/2] Ensure descriptive error when no github.com remotes found --- context/context.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/context/context.go b/context/context.go index a877b2053..385425958 100644 --- a/context/context.go +++ b/context/context.go @@ -201,13 +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") + 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 }