зеркало из https://github.com/mislav/hub.git
Родитель
76d8468673
Коммит
ce36a32617
|
@ -34,7 +34,7 @@ module Hub
|
|||
# provides git interrogation methods
|
||||
extend Context
|
||||
|
||||
NAME_RE = /[\w.-]+/
|
||||
NAME_RE = /\w[\w.-]*/
|
||||
OWNER_RE = /[a-zA-Z0-9-]+/
|
||||
NAME_WITH_OWNER_RE = /^(?:#{NAME_RE}|#{OWNER_RE}\/#{NAME_RE})$/
|
||||
|
||||
|
@ -181,7 +181,7 @@ module Hub
|
|||
else
|
||||
# $ hub clone rtomayko/tilt
|
||||
# $ hub clone tilt
|
||||
if arg =~ NAME_WITH_OWNER_RE
|
||||
if arg =~ NAME_WITH_OWNER_RE and !File.directory?(arg)
|
||||
# FIXME: this logic shouldn't be duplicated here!
|
||||
name, owner = arg, nil
|
||||
owner, name = name.split('/', 2) if name.index('/')
|
||||
|
|
|
@ -160,6 +160,16 @@ class HubTest < Test::Unit::TestCase
|
|||
assert_forwarded "clone ./test"
|
||||
end
|
||||
|
||||
def test_unchanged_clone_from_existing_directory
|
||||
stub_no_git_repo
|
||||
assert_forwarded "clone test"
|
||||
end
|
||||
|
||||
def test_local_clone_with_destination
|
||||
stub_no_git_repo
|
||||
assert_forwarded "clone -l . ../copy"
|
||||
end
|
||||
|
||||
def test_clone_with_host_alias
|
||||
stub_no_git_repo
|
||||
assert_forwarded "clone server:git/repo.git"
|
||||
|
|
Загрузка…
Ссылка в новой задаче