未验证 提交 96a68cf1 编写于 作者: M Mislav Marohnić 提交者: GitHub

Merge pull request #1653 from github/detect-pushable-forks

Have `fetch` use writable push URL for writeable fork
......@@ -61,7 +61,7 @@ func transformFetchArgs(args *Args) error {
continue
}
projects[project] = repo.Private
projects[project] = repo.Private || repo.Permissions.Push
}
}
}
......
......@@ -35,7 +35,10 @@ Feature: hub fetch
Scenario: Creates new remote
Given the GitHub API server:
"""
get('/repos/mislav/dotfiles') { json :private => false }
get('/repos/mislav/dotfiles') {
json :private => false,
:permissions => { :push => false }
}
"""
When I successfully run `hub fetch mislav`
Then "git fetch mislav" should be run
......@@ -72,6 +75,19 @@ Feature: hub fetch
And the url for "mislav" should be "git@github.com:mislav/dotfiles.git"
And there should be no output
Scenario: Writeable repo
Given the GitHub API server:
"""
get('/repos/mislav/dotfiles') {
json :private => false,
:permissions => { :push => true }
}
"""
When I successfully run `hub fetch mislav`
Then "git fetch mislav" should be run
And the url for "mislav" should be "git@github.com:mislav/dotfiles.git"
And there should be no output
Scenario: Fetch with options
Given the GitHub API server:
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册