Unbreak normal `git fetch` command with URL and refspec

Fixes #1243
This commit is contained in:
Mislav Marohnić 2016-09-08 14:29:44 +02:00
Родитель 3a69a3ba78
Коммит 660602b741
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -48,7 +48,7 @@ func tranformFetchArgs(args *Args) error {
currentProject, currentProjectErr := localRepo.CurrentProject()
projects := make(map[*github.Project]bool)
ownerRegexp := regexp.MustCompile(OwnerRe)
ownerRegexp := regexp.MustCompile(fmt.Sprintf("^%s$", OwnerRe))
for _, name := range names {
if ownerRegexp.MatchString(name) && !isCloneable(name) {
_, err := localRepo.RemoteByName(name)

Просмотреть файл

@ -15,6 +15,12 @@ Feature: hub fetch
Then the git command should be unchanged
And there should be no output
Scenario: Fetch from non-GitHub source via refspec
Given the "origin" remote has url "ssh://dev@codeserver.dev.xxx.drush.in/~/repository.git"
When I successfully run `hub fetch ssh://myusername@a.specific.server:1234/existing-project/gerrit-project-name refs/changes/16/6116/1`
Then the git command should be unchanged
And there should be no output
Scenario: Fetch from local bundle
Given the GitHub API server:
"""