From cfcd03a7c59eaa6b81de8c767bbd91e6d278c0f2 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Tue, 13 May 2014 11:27:02 -0700 Subject: Fix issue where force=>true was not destroying repository then recreating --- lib/puppet/provider/vcsrepo/git.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/puppet/provider/vcsrepo') diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index b2e893b..fafe4bf 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -140,7 +140,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) if @resource.value(:remote) != 'origin' args.push('--origin', @resource.value(:remote)) end - if !File.exist?(File.join(@resource.value(:path), '.git')) + if !working_copy_exists? args.push(source, path) Dir.chdir("/") do git_with_identity(*args) @@ -271,6 +271,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) end def get_revision(rev) + if @resource.value(:force) && working_copy_exists? + create + end if !working_copy_exists? create end -- cgit v1.2.3