Tighten regex to avoid matching the word 'commit' in message
authorSimon Forman <simon@pachube.com>
Mon, 18 Mar 2013 13:59:56 +0000 (13:59 +0000)
committerSimon Forman <simon@pachube.com>
Mon, 18 Mar 2013 13:59:56 +0000 (13:59 +0000)
lib/puppet/provider/vcsrepo/git.rb

index ad69f7d..0e91c23 100644 (file)
@@ -54,7 +54,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
     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 }
+      canonical = at_path { git_with_identity('show', @resource.value(:revision)).scan(/^commit (.*)/).to_s }
     else
       canonical = at_path { git_with_identity('rev-parse', @resource.value(:revision)).chomp }
     end