diff options
author | Mike Gerwitz <gerwitzm@lovullo.com> | 2013-12-02 11:38:56 -0500 |
---|---|---|
committer | Mike Gerwitz <gerwitzm@lovullo.com> | 2013-12-02 12:24:04 -0500 |
commit | 8837be29ff114228f86d67c59337119120690e44 (patch) | |
tree | 624591a7ef2f67b2bee80b05e2357da18fc257c0 /lib | |
parent | 4689c514a12764933a9cb1e2858343f0ba5923b3 (diff) |
Using rev-parse to determine branch name of HEAD for on_branch? method
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 6bc1c3d..17275c4 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -39,7 +39,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) def latest branch = on_branch? - if branch == '(no branch)' + if branch == '' return get_revision('HEAD') else return get_revision("#{@resource.value(:remote)}/%s" % branch) @@ -253,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 |