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 941c0f9  Fetch svndir once
941c0f9 is described below

commit 941c0f9685f5973d85569061bd0e0312828a18e2
Author: Sebb <[email protected]>
AuthorDate: Sat Nov 30 00:18:39 2019 +0000

    Fetch svndir once
---
 www/secretary/workbench/views/actions/icla2.json.rb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/www/secretary/workbench/views/actions/icla2.json.rb 
b/www/secretary/workbench/views/actions/icla2.json.rb
index 74ea240..a25b4d8 100644
--- a/www/secretary/workbench/views/actions/icla2.json.rb
+++ b/www/secretary/workbench/views/actions/icla2.json.rb
@@ -22,11 +22,11 @@ _personalize_email(env.user)
 #                        move existing document                        #
 ########################################################################
 
-iclas = ASF::SVN['iclas'].untaint
+svndir = ASF::SVN['iclas'].untaint
 @filename.untaint if @filename =~ /\A\w[-.\w]*\z/
 
-if not Dir.exist? "#{iclas}/#@filename"
-  @existing = File.basename(Dir["#{iclas}/#@filename.*"].first)
+if not Dir.exist? "#{svndir}/#@filename"
+  @existing = File.basename(Dir["#{svndir}/#@filename.*"].first)
   task "svn mv #@existing #@filename/icla#{File.extname(@existing)}" do
     form do
       _input value: @existing, name: 'existing'
@@ -59,7 +59,6 @@ end
 ########################################################################
 
 # determine initial value for the counter
-svndir = ASF::SVN['iclas']
 count = (Dir["#{svndir}/#@filename/*"].
       map {|name| name[/.*(\d+)\./, 1] || 1}.map(&:to_i).max || 1) + 1
 

Reply via email to