Fixed an issue with 8e51aebd4cf77c7d68ee that broke git when you didn't specify a...
authorNate Mueller <nate@nearbuysystems.com>
Thu, 28 Jul 2011 02:52:03 +0000 (19:52 -0700)
committerNate Mueller <nate@nearbuysystems.com>
Thu, 28 Jul 2011 02:52:03 +0000 (19:52 -0700)
lib/puppet/provider/vcsrepo/git.rb

index 4fbb534..e624b49 100644 (file)
@@ -51,6 +51,8 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
   def revision
     update_references
     current = at_path { git_with_identity('rev-parse', 'HEAD').chomp }
+    return current unless @resource.value(:revision)
+
     if tag_revision?(@resource.value(:revision))
       canonical = at_path { git_with_identity('show', @resource.value(:revision)).scan(/commit (.*)/).to_s }
     else