summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorTravis Fields <tfields@commercehub.com>2014-05-13 11:27:02 -0700
committerTravis Fields <tfields@commercehub.com>2014-05-13 13:17:14 -0700
commitcfcd03a7c59eaa6b81de8c767bbd91e6d278c0f2 (patch)
tree9c12b98a82ea0666d9ba8b5925b51a7e547f1896 /lib/puppet/provider/vcsrepo
parent46588aa62d444c5f0a538cccec357a80cd191b93 (diff)
downloadpuppet-vcsrepo-cfcd03a7c59eaa6b81de8c767bbd91e6d278c0f2.tar.gz
puppet-vcsrepo-cfcd03a7c59eaa6b81de8c767bbd91e6d278c0f2.tar.bz2
Fix issue where force=>true was not destroying repository then recreating
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb5
1 files changed, 4 insertions, 1 deletions
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