diff options
author | Aaron Stone <aaron@serendipity.cx> | 2014-09-17 17:31:23 -0700 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2014-09-17 17:31:23 -0700 |
commit | 38c9c20c5abb5a19917ee3af9e0b6f1f1e8a0b49 (patch) | |
tree | c1061dfe4ac6abc80618e25538ed873c0644db84 | |
parent | fc396a25497f373e0202c62590564e2b3ffed71a (diff) | |
parent | 0e7c0b06e952d5133bd7f9f055d680cb704e213e (diff) |
Merge pull request #207 from sodabrew/excludes_string
Handle both Array/Enumerable and String values for excludes parameter
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index 0a142bb..48bbe7d 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -281,7 +281,16 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) # @!visibility private def set_excludes - at_path { open('.git/info/exclude', 'w') { |f| @resource.value(:excludes).each { |ex| f.write(ex + "\n") }}} + # Excludes may be an Array or a String. + at_path do + open('.git/info/exclude', 'w') do |f| + if @resource.value(:excludes).respond_to?(:each) + @resource.value(:excludes).each { |ex| f.puts ex } + else + f.puts @resource.value(:excludes) + end + end + end end # Finds the latest revision or sha of the current branch if on a branch, or |