summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorHuan Du <i@huandu.me>2014-02-12 22:40:56 +0800
committerHuan Du <i@huandu.me>2014-02-12 22:40:56 +0800
commit9c873e1c56f1147a8fcdd01b804f744deebb53f6 (patch)
treec667fb6ec94b206bf84c2f7625d501368d861ddc /lib/puppet/provider/vcsrepo
parent50079b58192ed7a2af1ba6756f75084bc74d33e8 (diff)
downloadpuppet-vcsrepo-9c873e1c56f1147a8fcdd01b804f744deebb53f6.tar.gz
puppet-vcsrepo-9c873e1c56f1147a8fcdd01b804f744deebb53f6.tar.bz2
use `git rev-parse` to get tag canonical revision.
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index c96095b..b2e893b 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -52,7 +52,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('rev-parse', @resource.value(:revision)).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 }