diff options
-rw-r--r-- | lib/chef/provider/git.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/git_spec.rb | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb index 5708fed1f5..a36a668759 100644 --- a/lib/chef/provider/git.rb +++ b/lib/chef/provider/git.rb @@ -147,7 +147,7 @@ class Chef Chef::Log.info "#{@new_resource} cloning repo #{@new_resource.repository} to #{@new_resource.destination}" - clone_cmd = "git clone #{args.join(' ')} '#{@new_resource.repository}' '#{@new_resource.destination}'" + clone_cmd = "git clone #{args.join(' ')} \"#{@new_resource.repository}\" \"#{@new_resource.destination}\"" shell_out!(clone_cmd, run_options(:log_level => :info)) end end diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index f6d1254f57..07ceb6173a 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -168,7 +168,7 @@ SHAS it "runs a clone command with default git options" do @resource.user "deployNinja" @resource.ssh_wrapper "do_it_this_way.sh" - expected_cmd = "git clone 'git://github.com/opscode/chef.git' '/my/deploy/dir'" + expected_cmd = "git clone \"git://github.com/opscode/chef.git\" \"/my/deploy/dir\"" @provider.should_receive(:shell_out!).with(expected_cmd, :user => "deployNinja", :environment =>{"GIT_SSH"=>"do_it_this_way.sh"}, :log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT) @@ -179,7 +179,7 @@ SHAS @resource.user "deployNinja" @resource.destination "/Application Support/with/space" @resource.ssh_wrapper "do_it_this_way.sh" - expected_cmd = "git clone 'git://github.com/opscode/chef.git' '/Application Support/with/space'" + expected_cmd = "git clone \"git://github.com/opscode/chef.git\" \"/Application Support/with/space\"" @provider.should_receive(:shell_out!).with(expected_cmd, :user => "deployNinja", :environment =>{"GIT_SSH"=>"do_it_this_way.sh"}, :log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT) @provider.clone @@ -187,14 +187,14 @@ SHAS it "compiles a clone command using --depth for shallow cloning" do @resource.depth 5 - expected_cmd = "git clone --depth 5 'git://github.com/opscode/chef.git' '/my/deploy/dir'" + expected_cmd = "git clone --depth 5 \"git://github.com/opscode/chef.git\" \"/my/deploy/dir\"" @provider.should_receive(:shell_out!).with(expected_cmd, {:log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT}) @provider.clone end it "compiles a clone command with a remote other than ``origin''" do @resource.remote "opscode" - expected_cmd = "git clone -o opscode 'git://github.com/opscode/chef.git' '/my/deploy/dir'" + expected_cmd = "git clone -o opscode \"git://github.com/opscode/chef.git\" \"/my/deploy/dir\"" @provider.should_receive(:shell_out!).with(expected_cmd, {:log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT}) @provider.clone end |