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

pull-request: better error message for invalid remotes/URLs

References #152
上级 4b57f61e
......@@ -73,6 +73,10 @@ module Hub
base_project = local_repo.main_project
head_project = local_repo.current_project
unless base_project
abort "Aborted: the origin remote doesn't point to a GitHub repository."
end
from_github_ref = lambda do |ref, context_project|
if ref.index(':')
owner, ref = ref.split(':', 2)
......
......@@ -861,6 +861,15 @@ class HubTest < Test::Unit::TestCase
assert_output expected, "pull-request hereyougo -f"
end
def test_pullrequest_invalid_remote
stub_repo_url('gh:singingwolfboy/sekrit.git')
stub_branch('refs/heads/feature')
stub_tracking('feature', 'origin', 'feature')
expected = "Aborted: the origin remote doesn't point to a GitHub repository.\n"
assert_output expected, "pull-request hereyougo"
end
def test_pullrequest_enterprise_no_tracking
stub_hub_host('git.my.org')
stub_repo_url('git@git.my.org:defunkt/hub.git')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册