summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-09-29 11:43:39 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2014-09-29 11:43:39 -0700
commit4098cf801f8d991ab163f5ce21b81c7807dde6ff (patch)
treec78958108a295b0a8529f9079a4da291889641e2 /lib
parent0819eafa6fd664815856fe0081dfcafabd59dcf6 (diff)
parent91fde923c3e5f576a480d871e8fa9dd4c06c6eb8 (diff)
downloadchef-4098cf801f8d991ab163f5ce21b81c7807dde6ff.tar.gz
Merge pull request #2116 from opscode/jdmundrawala/git-centos
Support checkout for git < 1.7.3
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/git.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb
index aa58fdc4a1..9a2e6e2291 100644
--- a/lib/chef/provider/git.rb
+++ b/lib/chef/provider/git.rb
@@ -150,7 +150,7 @@ class Chef
converge_by("checkout ref #{sha_ref} branch #{@new_resource.revision}") do
# checkout into a local branch rather than a detached HEAD
- shell_out!("git checkout -B #{@new_resource.checkout_branch} #{sha_ref}", run_options(:cwd => @new_resource.destination))
+ shell_out!("git branch -f #{@new_resource.checkout_branch} #{sha_ref}; git checkout #{@new_resource.checkout_branch}", run_options(:cwd => @new_resource.destination))
Chef::Log.info "#{@new_resource} checked out branch: #{@new_resource.revision} onto: #{@new_resource.checkout_branch} reference: #{sha_ref}"
end
end