summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index 47e84d2..17275c4 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -39,9 +39,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
def latest
branch = on_branch?
- if branch == 'master'
- return get_revision("#{@resource.value(:remote)}/HEAD")
- elsif branch == '(no branch)'
+ if branch == ''
return get_revision('HEAD')
else
return get_revision("#{@resource.value(:remote)}/%s" % branch)
@@ -255,7 +253,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
end
def on_branch?
- at_path { git_with_identity('branch', '-a') }.split(/\n/).grep(/\*/).first.to_s.gsub('*', '').strip
+ at_path { git_with_identity('rev-parse', '--abbrev-ref', 'HEAD') }
end
def tags