summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Soloway <pete@puppetlabs.com>2015-04-21 13:56:15 -0700
committerPete Soloway <pete@puppetlabs.com>2015-04-21 13:56:15 -0700
commit5998ab9ad89ca7c2926cef4b09f46e954f734aea (patch)
tree6fd839df10c93a80332e64b3e71d02d3c6d5516e
parentb1e0a48fa095aac7d2aea01f616a164890a10c2d (diff)
parent7aab800dff04c485308edd906ce234e83ffb154e (diff)
Merge upstream changes into readme branch
-rw-r--r--README.markdown2
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb5
-rw-r--r--lib/puppet/type/vcsrepo.rb7
3 files changed, 12 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown
index 924a317..34988bc 100644
--- a/README.markdown
+++ b/README.markdown
@@ -736,4 +736,4 @@ Puppet Labs modules on the Puppet Forge are open projects, and community contrib
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
-You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) \ No newline at end of file
+You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing)
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