提交 3cce40c6 编写于 作者: M Mislav Marohnić

Have `fetch` use writable push URL for writeable fork

This is to avoid having a writeable fork added with `git://` protocol
(the default when `hub.protocol` is not configured).

This matches the behavior of `hub clone`.
上级 55dec7d3
......@@ -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.
先完成此消息的编辑!
想要评论请 注册