From dcd0d143bdc6244688e62aa555156e44ccf5f6bb Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Mon, 18 Mar 2013 13:02:18 -0700 Subject: [PATCH] Allow non-root users to clone a repo Without this, git will report that it can't change back to /root --- lib/puppet/provider/vcsrepo/git.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 6920c759..2d754b93 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -115,7 +115,9 @@ def clone_repository(source, path) 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