summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Fields <travis@puppetlabs.com>2014-05-15 22:00:14 -0700
committerTravis Fields <travis@puppetlabs.com>2014-05-15 22:00:14 -0700
commita909fe74c71e7e214087c3c95bb21e6dfd90c940 (patch)
treeb425c14ac79c5b172bf582724fa7a3c984f7e3b6
parenta213d71ec8d3e75bef909cc5c3f11aaea8b4e94d (diff)
downloadpuppet-vcsrepo-a909fe74c71e7e214087c3c95bb21e6dfd90c940.tar.gz
puppet-vcsrepo-a909fe74c71e7e214087c3c95bb21e6dfd90c940.tar.bz2
update to use -a and desired for hard reset
-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 b4bafbf..61044e0 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -85,7 +85,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
# might be worthwhile to have an allow_local_changes param to decide
# whether to reset or pull when we're ensuring latest.
at_path {
- git_with_identity('reset', '--hard', "#{@resource.value(:remote)}/#{@resource.value(:revision)}")
+ git_with_identity('reset', '--hard', "#{@resource.value(:remote)}/#{desired}")
if detached?
git_with_identity('checkout', "#{@resource.value(:revision)}")
git_with_identity('pull')
@@ -266,14 +266,14 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
def on_branch?
at_path {
- matches = git_with_identity('branch', '--list').match /\*\s+(.*)/
+ matches = git_with_identity('branch', '-a').match /\*\s+(.*)/
matches[1] unless matches[1].match /detached/
}
end
def detached?
at_path {
- git_with_identity('branch', '--list').match /\*\s+\(detached from.*\)/
+ git_with_identity('branch', '-a').match /\*\s+\(detached from.*\)/
}
end