Fix hub when a remote has local path instead of URL

Fixes #470
This commit is contained in:
Mislav Marohnić 2014-01-25 15:08:33 +01:00
Родитель 7672e14c8d
Коммит a59316ea94
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -112,3 +112,9 @@ Feature: hub browse
Warning: the `-p` flag has no effect anymore\n
"""
But "open https://github.com/defunkt/hub" should be run
Scenario: Repo with remote with local path
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And the "upstream" remote has url "../path/to/another/repo.git"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles" should be run

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

@ -219,7 +219,7 @@ module Hub
end
def origin_remote
remotes.first
remotes.detect {|r| r.urls.any? }
end
def remote_by_name(remote_name)
@ -409,7 +409,7 @@ module Hub
rescue URI::InvalidURIError
end
end
end
end.compact
end
def with_normalized_url(url)