diff options
author | TP Honey <tphoney@users.noreply.github.com> | 2015-04-21 10:01:39 +0100 |
---|---|---|
committer | TP Honey <tphoney@users.noreply.github.com> | 2015-04-21 10:01:39 +0100 |
commit | 7aab800dff04c485308edd906ce234e83ffb154e (patch) | |
tree | ead6a514a6381f77579c653d7805d84b906b521b | |
parent | 210ca5acd8eecc909eae248745e24f0debd66ffc (diff) | |
parent | 28f8646e4669bacf7a87ffc8694715333355cd32 (diff) | |
download | puppet-vcsrepo-7aab800dff04c485308edd906ce234e83ffb154e.tar.gz puppet-vcsrepo-7aab800dff04c485308edd906ce234e83ffb154e.tar.bz2 |
Merge pull request #224 from puppet-by-examples/single-branch
Shallow clone with one commit that corresponds to arbitrary tag from arbitrary branch
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 5 | ||||
-rw-r--r-- | lib/puppet/type/vcsrepo.rb | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 000032e..8101253 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -5,7 +5,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) commands :git => 'git' - has_features :bare_repositories, :reference_tracking, :ssh_identity, :multiple_remotes, :user, :depth, :submodules + has_features :bare_repositories, :reference_tracking, :ssh_identity, :multiple_remotes, :user, :depth, :branch, :submodules def create if @resource.value(:revision) and @resource.value(:ensure) == :bare @@ -181,6 +181,9 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) if @resource.value(:depth) and @resource.value(:depth).to_i > 0 args.push('--depth', @resource.value(:depth).to_s) end + if @resource.value(:branch) + args.push('--branch', @resource.value(:branch).to_s) + end if @resource.value(:ensure) == :bare args << '--bare' end diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index 52eace8..e5dfbb5 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -40,6 +40,9 @@ Puppet::Type.newtype(:vcsrepo) do feature :depth, "The provider can do shallow clones" + feature :branch, + "The name of the branch" + feature :p4config, "The provider understands Perforce Configuration" @@ -207,6 +210,10 @@ Puppet::Type.newtype(:vcsrepo) do desc "The value to be used to do a shallow clone." end + newparam :branch, :required_features => [:branch] do + desc "The name of the branch to clone." + end + newparam :p4config, :required_features => [:p4config] do desc "The Perforce P4CONFIG environment." end |