From a909fe74c71e7e214087c3c95bb21e6dfd90c940 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Thu, 15 May 2014 22:00:14 -0700 Subject: update to use -a and desired for hard reset --- lib/puppet/provider/vcsrepo/git.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3