提交 01dad764 编写于 作者: M Mislav Marohnić

Fix vanilla `fetch` with non-GitHub remotes`

Fixes #1227
上级 ddd5b167
......@@ -44,8 +44,7 @@ func tranformFetchArgs(args *Args) error {
localRepo, err := github.LocalRepo()
utils.Check(err)
currentProject, err := localRepo.CurrentProject()
utils.Check(err)
currentProject, currentProjectErr := localRepo.CurrentProject()
projects := make(map[*github.Project]bool)
ownerRegexp := regexp.MustCompile(OwnerRe)
......@@ -53,6 +52,7 @@ func tranformFetchArgs(args *Args) error {
if ownerRegexp.MatchString(name) && !isCloneable(name) {
_, err := localRepo.RemoteByName(name)
if err != nil {
utils.Check(currentProjectErr)
project := github.NewProject(name, currentProject.Name, "")
gh := github.NewClient(project.Host)
repo, err := gh.Repository(project)
......
......@@ -9,6 +9,12 @@ Feature: hub fetch
Then the git command should be unchanged
And there should be no output
Scenario: Fetch existing remote from non-GitHub source
Given the "origin" remote has url "ssh://dev@codeserver.dev.xxx.drush.in/~/repository.git"
When I successfully run `hub fetch origin`
Then the git command should be unchanged
And there should be no output
Scenario: Fetch from local bundle
Given the GitHub API server:
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册