From 688c3cad1a277b4cb59445750fdf402a1c1774a3 Mon Sep 17 00:00:00 2001 From: "Joshua B. Bussdieker" Date: Wed, 25 Jun 2014 16:28:04 -0700 Subject: Fix issue with node changing every checkin --- lib/puppet/provider/vcsrepo/git.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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 } -- cgit v1.2.3