From f3f2ba4e3d2b9ee1214fddf05e3b1252d3a25c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Stein?= Date: Thu, 6 Jun 2019 09:51:09 +0200 Subject: [PATCH] Migration.rb: deal with $stdin being Nil (happend for some reason in production) --- lib/svn2git/migration.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/svn2git/migration.rb b/lib/svn2git/migration.rb index 4de8a9e..0147fa4 100755 --- a/lib/svn2git/migration.rb +++ b/lib/svn2git/migration.rb @@ -402,7 +402,12 @@ def run_command(cmd, exit_on_error=true, printout_output=false) # for input and place any received values on a queue for consumption by a pass-through thread that will forward # the contents to the underlying sub-process's stdin pipe. @stdin_thread ||= Thread.new do - loop { @stdin_queue << $stdin.gets.chomp } + loop do + str = $stdin.gets + if str + @stdin_queue << $stdin.gets.chomp + end + end end # Open4 forks, which JRuby doesn't support. But JRuby added a popen4-compatible method on the IO class,