diff options
author | Ben Ford <ben.ford@puppetlabs.com> | 2013-03-18 13:02:18 -0700 |
---|---|---|
committer | Ben Ford <ben.ford@puppetlabs.com> | 2013-03-18 13:02:18 -0700 |
commit | dcd0d143bdc6244688e62aa555156e44ccf5f6bb (patch) | |
tree | 5b30d9359d363563b8e460aeaa1d70bbd9b35223 /lib/puppet/provider/vcsrepo | |
parent | 339fc275e77a0c80a14bb4a0e38318990d3fb3e9 (diff) |
Allow non-root users to clone a repo
Without this, git will report that it can't change back to /root
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 6920c75..2d754b9 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -115,7 +115,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) end if !File.exist?(File.join(@resource.value(:path), '.git')) args.push(source, path) - git_with_identity(*args) + Dir.chdir("/") do + git_with_identity(*args) + end else notice "Repo has already been cloned" end |