summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoshua B. Bussdieker <jbussdieker@gmail.com>2014-06-25 16:28:04 -0700
committerJoshua B. Bussdieker <jbussdieker@gmail.com>2014-06-30 14:12:38 -0700
commit688c3cad1a277b4cb59445750fdf402a1c1774a3 (patch)
tree844249748303a318a7d813635b314ee95775bff7 /lib
parente42310c7fb082a20f4155d801e41b980400ae045 (diff)
Fix issue with node changing every checkin
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index 5c878ed..5c5dd07 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -52,7 +52,9 @@ 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('rev-parse', @resource.value(:revision)).chomp }
+ # git-rev-parse will give you the hash of the tag object itself rather than the commit it points to by default.
+ # Using tag^0 will return the actual commit.
+ canonical = at_path { git_with_identity('rev-parse', "#{@resource.value(:revision)}^0").chomp }
else
# if it's not a tag, look for it as a local ref
canonical = at_path { git_with_identity('rev-parse', '--revs-only', @resource.value(:revision)).chomp }