summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Stone <aaron@serendipity.cx>2014-06-30 14:39:00 -0700
committerAaron Stone <aaron@serendipity.cx>2014-06-30 14:39:00 -0700
commit3109167c1ec0ad574732a434918e508687438335 (patch)
treecf66313bebd36c3bdb057f7313f2a2b1901ab5f7 /lib
parentf903790bbb9156855daab5a181233cfea9e8e5c8 (diff)
parent688c3cad1a277b4cb59445750fdf402a1c1774a3 (diff)
Merge pull request #181 from jbussdieker/fix_resource_change_every_checkin
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 }