Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For #308 : Fix error undefined stdin #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/svn2git/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down