Commit 9223b1bc authored by Eloy Duran's avatar Eloy Duran

Quote all URIs given to git. Fixes #383.

parent 5ea0d332
...@@ -30,7 +30,7 @@ module Pod ...@@ -30,7 +30,7 @@ module Pod
puts "-> Creating cache git repo (#{cache_path})" if config.verbose? puts "-> Creating cache git repo (#{cache_path})" if config.verbose?
cache_path.rmtree if cache_path.exist? cache_path.rmtree if cache_path.exist?
cache_path.mkpath cache_path.mkpath
git "clone '#{url}' #{cache_path}" clone(url, cache_path)
end end
def removed_cached_repos_if_needed def removed_cached_repos_if_needed
...@@ -100,7 +100,7 @@ module Pod ...@@ -100,7 +100,7 @@ module Pod
def download_head def download_head
update_cache update_cache
git "clone '#{clone_url}' '#{target_path}'" clone(clone_url, target_path)
end end
def download_tag def download_tag
...@@ -116,7 +116,7 @@ module Pod ...@@ -116,7 +116,7 @@ module Pod
def download_commit def download_commit
ensure_ref_exists(options[:commit]) ensure_ref_exists(options[:commit])
git "clone '#{clone_url}' '#{target_path}'" clone(clone_url, target_path)
Dir.chdir(target_path) do Dir.chdir(target_path) do
git "checkout -b activated-pod-commit #{options[:commit]}" git "checkout -b activated-pod-commit #{options[:commit]}"
end end
...@@ -124,14 +124,18 @@ module Pod ...@@ -124,14 +124,18 @@ module Pod
def download_branch def download_branch
ensure_remote_branch_exists(options[:branch]) ensure_remote_branch_exists(options[:branch])
git "clone '#{clone_url}' '#{target_path}'" clone(clone_url, target_path)
Dir.chdir(target_path) do Dir.chdir(target_path) do
git "remote add upstream #{@url}" # we need to add the original url, not the cache url git "remote add upstream '#{@url}'" # we need to add the original url, not the cache url
git "fetch -q upstream" # refresh the branches git "fetch -q upstream" # refresh the branches
git "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch git "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch
puts "Just downloaded and checked out branch: #{options[:branch]} from upstream #{clone_url}" if config.verbose? puts "Just downloaded and checked out branch: #{options[:branch]} from upstream #{clone_url}" if config.verbose?
end end
end end
def clone(from, to)
git "clone '#{from}' '#{to}'"
end
end end
class GitHub < Git class GitHub < Git
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment