summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorAdam Gandelman <adam@janrain.com>2011-03-16 01:22:17 +0800
committerJames Turnbull <james@lovedthanlost.net>2011-05-20 18:04:06 -0700
commit5b89b20928fa262fc6683995b0e679fe13e00035 (patch)
treeeff0714b4b389b20f6f2cc27e14a45350eae9c2b /lib/puppet/provider/vcsrepo
parente481dec2c8465877cff35e4327a12fe600b1bab7 (diff)
downloadpuppet-vcsrepo-5b89b20928fa262fc6683995b0e679fe13e00035.tar.gz
puppet-vcsrepo-5b89b20928fa262fc6683995b0e679fe13e00035.tar.bz2
git.rb: update_references before touching tags. tags created since last vcsrepo run fail otherwise
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index bbcf14c..662ddff 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -42,12 +42,19 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
if branch == 'master'
return get_revision('origin/HEAD')
else
- return get_revision('origin/%s' % branch)
+ return get_revision('origin/%s' % branch)
end
end
def revision
- return get_revision('HEAD')
+ update_references
+ current = at_path { git('rev-parse', 'HEAD') }
+ canonical = at_path { git('rev-parse', @resource.value(:revision)) }
+ if current == canonical
+ @resource.value(:revision)
+ else
+ current
+ end
end
def revision=(desired)