From b3d62db242ca5da774f09ba62e1330d9ef8028a1 Mon Sep 17 00:00:00 2001 From: Pg Date: Sun, 27 Feb 2022 17:29:13 +0100 Subject: [PATCH] Fix error 'undefined local variable or method stdin' Since switch back from open4 to IO.popen (d19b9c8136ea6a3b64259c469e24ade4a2980423) the `stdin` object is no more defined. IO.popen bind input and output to same object (pipe). Thus, change `output` to `pipe` for IO.popen. --- lib/svn2git/migration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/svn2git/migration.rb b/lib/svn2git/migration.rb index 4de8a9e..801245c 100755 --- a/lib/svn2git/migration.rb +++ b/lib/svn2git/migration.rb @@ -407,10 +407,10 @@ def run_command(cmd, exit_on_error=true, printout_output=false) # Open4 forks, which JRuby doesn't support. But JRuby added a popen4-compatible method on the IO class, # so we can use that instead. - IO.popen("2>&1 #{cmd}") do |output| + IO.popen("2>&1 #{cmd}") do |pipe| threads = [] - threads << Thread.new(output) do |output| + threads << Thread.new(pipe) do |output| # git-svn seems to do all of its prompting for user input via STDERR. When it prompts for input, it will # not terminate the line with a newline character, so we can't split the input up by newline. It will, # however, use a space to separate the user input from the prompt. So we split on word boundaries here @@ -428,7 +428,7 @@ def run_command(cmd, exit_on_error=true, printout_output=false) # Simple pass-through thread to take anything the user types via STDIN and passes it through to the # sub-process's stdin pipe. - Thread.new do + Thread.new(pipe) do |stdin| loop do user_reply = @stdin_queue.pop