summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2013-12-03 09:54:21 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2013-12-04 21:02:20 -0500
commit69b93cefcdcd4a80d241dc71d5e6de90842faf11 (patch)
treee41c230bba51dd8963cc2d0a2238a6bcb1a999a2 /lib/puppet/provider/vcsrepo
parenta96a42e38b6c6d306ef158250658ae5673f383a3 (diff)
downloadpuppet-vcsrepo-69b93cefcdcd4a80d241dc71d5e6de90842faf11.tar.gz
puppet-vcsrepo-69b93cefcdcd4a80d241dc71d5e6de90842faf11.tar.bz2
Stripping git on_branch? return value; contains trailing newline
This commit also contains git provider `latest' method formatting changes; squashed by request.
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index 17275c4..d488271 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -39,10 +39,10 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
def latest
branch = on_branch?
- if branch == ''
+ if !branch
return get_revision('HEAD')
else
- return get_revision("#{@resource.value(:remote)}/%s" % branch)
+ return get_revision("#{@resource.value(:remote)}/#{branch}")
end
end
@@ -253,7 +253,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
end
def on_branch?
- at_path { git_with_identity('rev-parse', '--abbrev-ref', 'HEAD') }
+ at_path { git_with_identity('rev-parse', '--abbrev-ref', 'HEAD').chomp }
end
def tags