diff --git a/lib/homesick.rb b/lib/homesick.rb index 313117e..64d6d1e 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -30,6 +30,9 @@ class Homesick < Thor elsif uri =~ /\/([^\/]*)(\.git)?\Z/ destination = Pathname.new($1) git_clone uri + elsif uri =~ /[^:]+:([^:]+)(\.git)?\Z/ + destination = Pathname.new($1) + git_clone uri else raise "Unknown URI format: #{uri}" end diff --git a/spec/homesick_spec.rb b/spec/homesick_spec.rb index 2da7971..25b7859 100644 --- a/spec/homesick_spec.rb +++ b/spec/homesick_spec.rb @@ -40,6 +40,12 @@ describe Homesick do @homesick.clone 'http://github.com/technicalpickles/pickled-vim' end + it "should clone git repo like host-alias:repos.git" do + @homesick.should_receive(:git_clone).with('gitolite:pickled-vim.git') + + @homesick.clone 'gitolite:pickled-vim.git' + end + it "should not try to clone a malformed uri like malformed" do @homesick.should_not_receive(:git_clone)