diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-01-11 10:12:50 -0800 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-01-11 10:12:50 -0800 |
commit | f252283cf1501960f627e121d852b05f67c7214c (patch) | |
tree | c7c07c3b89776aef5d042ba999c8d98a6193cf8b /lib/puppet/provider/vcsrepo | |
parent | 7ac346413211f2fd58abc6a7bbce5d35de2a7a04 (diff) | |
parent | 7845ea132b0b40a83d3e9284723cbf63e2b61a82 (diff) |
Merge pull request #115 from instruct-br/use_remote_name_when_cloning_a_repo
git: actually use the remote parameter
Diffstat (limited to 'lib/puppet/provider/vcsrepo')
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index af38a59..cdae459 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -105,10 +105,10 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) end def update_remote_origin_url - current = git_with_identity('config', 'remote.origin.url') + current = git_with_identity('config', "remote.#{@resource.value(:remote)}.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)) + git_with_identity('config', "remote.#{@resource.value(:remote)}.url", @resource.value(:source)) end end end @@ -137,6 +137,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) if @resource.value(:ensure) == :bare args << '--bare' end + if @resource.value(:remote) != 'origin' + args.push('--origin', @resource.value(:remote)) + end if !File.exist?(File.join(@resource.value(:path), '.git')) args.push(source, path) Dir.chdir("/") do |