From 6915fa7e3799ff56233cf7e2c4d24686e435c401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Wed, 6 Mar 2013 17:06:26 +0100 Subject: Update origin if necessary before checking revision --- lib/puppet/provider/vcsrepo/git.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 9254243..61c225d 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -93,8 +93,18 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) working_copy_exists? || bare_exists? end + def update_remote_origin_url + current = git_with_identity('config', 'remote.origin.url') + unless @resource.value(:source).nil? + if current.nil? or current.strip != @resource.value(:source) + git_with_identity('config', 'remote.origin.url', @resource.value(:source)) + end + end + end + def update_references at_path do + update_remote_origin_url git_with_identity('fetch', @resource.value(:remote)) git_with_identity('fetch', '--tags', @resource.value(:remote)) update_owner_and_excludes @@ -250,6 +260,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) create end at_path do + update_remote_origin_url git_with_identity('fetch', @resource.value(:remote)) git_with_identity('fetch', '--tags', @resource.value(:remote)) end -- cgit v1.2.3