Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add shellescape for some path arguments #14

Merged
merged 2 commits into from

3 participants

@chipp

git.clone method: add shellescape for from string
git.download_and_extract_tarball method: add shellescape for all paths
update "updates the cache if the ref is not available": add shellescape for git clone arguments

@chipp chipp git.clone method: add shellescape for from string
git.download_and_extract_tarball method: add shellescape for all paths
update "updates the cache if the ref is not available": add shellescape for git clone arguments
7b0e373
@chipp chipp referenced this pull request
Closed

git clone error #13

@fabiopelosin

Nice thanks... could you add an entry to the Changelog crediting yourself?

@chipp

Done :)

@orta
Owner

:beers:

@fabiopelosin

Ace :dancers:

@fabiopelosin fabiopelosin merged commit 7e65134 into CocoaPods:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 31, 2014
  1. @chipp

    git.clone method: add shellescape for from string

    chipp authored
    git.download_and_extract_tarball method: add shellescape for all paths
    update "updates the cache if the ref is not available": add shellescape for git clone arguments
  2. @chipp
This page is out of date. Refresh to see the latest.
View
8 CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## Master
+
+###### Enhancements
+
+* add shellescape for some path arguments in git.rb
+ [Vladimir Burdukov](https://github.com/chipp)
+ [#14](https://github.com/CocoaPods/cocoapods-downloader/pull/14)
+
## 0.4.0
###### Enhancements
View
4 lib/cocoapods-downloader/git.rb
@@ -64,7 +64,7 @@ def clone_url
#
def clone(from, to, flags = '')
ui_sub_action("Cloning to Pods folder") do
- command = %Q|clone #{from} #{to.shellescape}|
+ command = %Q|clone #{from.shellescape} #{to.shellescape}|
command << ' ' + flags if flags
git!(command)
end
@@ -275,7 +275,7 @@ def download_and_extract_tarball(id)
tmpfile.write Zlib::GzipReader.new(archive).read
end
- system "tar xf #{tmpfile.path} -C #{target_path} --strip-components 1"
+ system "tar xf #{tmpfile.path.shellescape} -C #{target_path.shellescape} --strip-components 1"
end
end
end
View
2  spec/git_spec.rb
@@ -167,7 +167,7 @@ def downloader.execute_command(executable, command, raise_on_failure = false)
it "updates the cache if the ref is not available" do
# create the origin repo and the cache
tmp_repo_path = tmp_folder + 'git-repo-source'
- `git clone #{fixture('git-repo')} #{tmp_repo_path}`
+ `git clone #{fixture('git-repo').shellescape} #{tmp_repo_path.shellescape}`
options = { :git => tmp_repo_path, :commit => '7ad3a6c' }
downloader = Downloader.for_target(tmp_folder('checkout'), options)
downloader.download
Something went wrong with that request. Please try again.