You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/06/30 14:42:18 UTC
[whimsy] branch master updated: Parameter validation
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new c98f0ff Parameter validation
c98f0ff is described below
commit c98f0ff2cbf80a6d87450fdbf70f8ff505449433
Author: Sebb <se...@apache.org>
AuthorDate: Tue Jun 30 15:42:08 2020 +0100
Parameter validation
---
lib/whimsy/asf/svn.rb | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index dacac64..9bff1a0 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -643,6 +643,12 @@ module ASF
# commands << ['rm',url3]
# ASF::SVN.svnmucc_(commands,message,env,_)
def self.svnmucc_(commands, msg, env, _, revision=nil, temp=nil)
+
+ raise ArgumentError.new 'commands must be an array' unless Array === commands
+ raise ArgumentError.new 'msg must not be nil' unless msg
+ raise ArgumentError.new 'env must not be nil' unless env
+ raise ArgumentError.new '_ must not be nil' unless _
+
require 'tempfile'
tmpdir = temp ? temp : Dir.mktmpdir.untaint
@@ -650,6 +656,7 @@ module ASF
cmdfile = Tempfile.new('svnmucc_input', tmpdir)
# add the commands
commands.each do |cmd|
+ raise ArgumentError.new 'command entries must be an array' unless Array === cmd
cmd.each do |arg|
cmdfile.puts(arg)
end