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

GitHub remote urls don't have to necessarily end in ".git"

上级 539b4c52
...@@ -233,8 +233,9 @@ module Hub ...@@ -233,8 +233,9 @@ module Hub
end end
def project def project
if urls.find { |u| u =~ %r{\bgithub\.com[:/](.+)/(.+).git$} } if urls.find { |u| u =~ %r{\bgithub\.com[:/](.+)/(.+)\z} }
GithubProject.new local_repo, $1, $2 owner = $1
GithubProject.new local_repo, owner, $2.sub(/\.git$/, '')
end end
end end
......
...@@ -1045,6 +1045,11 @@ config ...@@ -1045,6 +1045,11 @@ config
assert_command "browse --", "open https://github.com/defunkt/hub" assert_command "browse --", "open https://github.com/defunkt/hub"
end end
def test_hub_browse_current_https_uri
stub_repo_url "https://github.com/defunkt/hub"
assert_command "browse", "open https://github.com/defunkt/hub"
end
def test_hub_browse_commit_from_current def test_hub_browse_commit_from_current
assert_command "browse -- commit/6616e4", "open https://github.com/defunkt/hub/commit/6616e4" assert_command "browse -- commit/6616e4", "open https://github.com/defunkt/hub/commit/6616e4"
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册