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 f3a7d535 Let _svn_build_cmd handle auth
f3a7d535 is described below

commit f3a7d535b06b4a59aec779eec4fc5fdebc348fe5
Author: Sebb <s...@apache.org>
AuthorDate: Wed May 18 22:55:36 2022 +0100

    Let _svn_build_cmd handle auth
---
 lib/whimsy/asf/svn.rb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 086d5c42..0d1981a9 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -468,14 +468,16 @@ module ASF
         %i[env user password].each do |k|
           options.delete(k)
         end
+        # convert auth for use by _svn_build_cmd
+        auth.flatten.each_slice(2) do |a, b|
+          options[:user] = b if a == "--username"
+          options[:password] = b if a == "--password"
+        end
       end
 
 
       cmd, stdin = self._svn_build_cmd(command, path, options)
       sysopts[:stdin] = stdin if stdin
-      if auth # insert after the command name
-        cmd.insert(2, auth, '--no-auth-cache')
-      end
 
       # This ensures the output is captured in the response
       _.system ['echo', [cmd, sysopts].inspect] if options[:verbose] # 
includes auth

Reply via email to