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/10 22:00:38 UTC

[whimsy] branch master updated: Fix up _.system auth handling

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 ac7327f  Fix up _.system auth handling
ac7327f is described below

commit ac7327f383e512ea6798c0cccf7b296bc2bd6aba
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jun 10 23:00:27 2020 +0100

    Fix up _.system auth handling
---
 lib/whimsy/asf/svn.rb | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 8c7dc1d..16018ad 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -386,10 +386,10 @@ module ASF
         user = options[:user] if password
       end
       # password was supplied, add credentials
-      if password and not options[:verbose]
+      if password and not options[:dryrun] # don't add auth for dryrun
         creds = ['--no-auth-cache', '--username', user]
-        if self.passwordStdinOK?() && false # not sure how to support this
-          open_opts[:stdin_data] = password
+        if self.passwordStdinOK?()
+          open_opts[:stdin] = password
           creds << '--password-from-stdin'
         else
           creds += ['--password', password]
@@ -407,12 +407,16 @@ module ASF
 
       p cmd if options[:verbose] # includes auth
 
-      if options[:dryrun] # before creds added
+      if options[:dryrun] # excludes auth
         # TODO: improve this
         return _.system ['echo', cmd.inspect]
       end
 
-      _.system cmd
+      if open_opts.size > 0 # any options for the Open3 command?
+        _.system cmd, open_opts, {} # needs two hashes
+      else
+        _.system cmd
+      end
     end
 
     # As for self.svn_, but failures cause a RuntimeError