Fix (#10788) - Avoid unnecessary remote operations in the vcsrepo type
authorMatthias Pigulla <mp@webfactory.de>
Sat, 12 Nov 2011 12:27:56 +0000 (13:27 +0100)
committerMatthias Pigulla <mp@webfactory.de>
Sat, 12 Nov 2011 12:27:56 +0000 (13:27 +0100)
lib/puppet/type/vcsrepo.rb

index 9bf8311..83a8318 100644 (file)
@@ -73,7 +73,7 @@ Puppet::Type.newtype(:vcsrepo) do
       prov = @resource.provider
       if prov
         if prov.working_copy_exists?
-          prov.latest? ? :latest : :present
+          (@should.include?(:latest) && prov.latest?) ? :latest : :present
         elsif prov.class.feature?(:bare_repositories) and prov.bare_exists?
           :bare
         else