Skip to content

Commit d46f525

Browse files
Corner, Bradleysergiomb2
Corner, Bradley
authored andcommitted
There are two bugs filed at debian. This patches should fix them in a minimal and reasonable way.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905832 [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893997
1 parent 3651330 commit d46f525

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

lib/svn2git/migration.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def run!
3232
ENV["LANGUAGE"]="en_US"
3333
log "LANGUAGE is: #{ENV["LANGUAGE"]}\n"
3434
end
35-
35+
3636
if @options[:rebase]
3737
get_branches
3838
elsif @options[:rebasebranch]
@@ -388,7 +388,7 @@ def fix_branches
388388
# Our --rebase option obviates the need for read-only tracked remotes, however. So, we'll
389389
# deprecate the old option, informing those relying on the old behavior that they should
390390
# use the newer --rebase otion.
391-
if status =~ /Cannot setup tracking information/m
391+
if status =~ /fatal:.+'#{branch}'.+/
392392
@cannot_setup_tracking_information = true
393393
run_command(Svn2Git::Migration.checkout_svn_branch(branch))
394394
else
@@ -461,13 +461,17 @@ def run_command(cmd, exit_on_error=true, printout_output=false)
461461
# sub-process's stdin pipe.
462462
Thread.new do
463463
loop do
464-
user_reply = @stdin_queue.pop
464+
begin
465+
user_reply = @stdin_queue.pop
465466

466-
# nil is our cue to stop looping (pun intended).
467-
break if user_reply.nil?
467+
# nil is our cue to stop looping (pun intended).
468+
break if user_reply.nil?
468469

469-
stdin.puts user_reply
470-
stdin.close
470+
stdin.puts user_reply
471+
stdin.close
472+
rescue IOError
473+
$stdout.print "No input requested.\n"
474+
end
471475
end
472476
end
473477

@@ -507,7 +511,7 @@ def git_config_command
507511
if @git_config_command.nil?
508512
status = run_command('git config --local --get user.name', false)
509513

510-
@git_config_command = if status =~ /unknown option/m
514+
@git_config_command = if status =~ /error: .+\s.+git config \[.+/m
511515
'git config'
512516
else
513517
'git config --local'

0 commit comments

Comments
 (0)