diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 6 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/svn.rb | 2 | ||||
-rw-r--r-- | lib/puppet/type/vcsrepo.rb | 10 |
3 files changed, 6 insertions, 12 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 9e1903c..13e0793 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -83,7 +83,11 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) end def working_copy_exists? - File.directory?(File.join(@resource.value(:path), '.git')) + if @resource.value(:source) and File.exists?(File.join(@resource.value(:path), '.git', 'config')) + File.readlines(File.join(@resource.value(:path), '.git', 'config')).grep(/#{@resource.value(:source)}/).any? + else + File.directory?(File.join(@resource.value(:path), '.git')) + end end def exists? diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 316a3a1..a1b1714 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -24,7 +24,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) if File.directory?(@resource.value(:path)) # :path is an svn checkout return true if File.directory?(File.join(@resource.value(:path), '.svn')) - if File.directory?(File.join(@resource.value(:path), 'format')) + if File.file?(File.join(@resource.value(:path), 'format')) # :path is an svn server return true if svnlook('uuid', @resource.value(:path)) end diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index 3f34c57..3bf4029 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -103,16 +103,6 @@ Puppet::Type.newtype(:vcsrepo) do prov = @resource.provider if prov if prov.working_copy_exists? - if @resource.value(:force) - if noop - notice "Noop Mode - Would have deleted repository and re-created from latest" - else - notice "Deleting current repository before recloning" - prov.destroy - notice "Create repository from latest" - prov.create - end - end (@should.include?(:latest) && prov.latest?) ? :latest : :present elsif prov.class.feature?(:bare_repositories) and prov.bare_exists? :bare |