@@ -10,17 +10,17 @@ class Migration
1010
1111 def initialize ( args )
1212 @options = parse ( args )
13- if @options . fetch ( :rebase , false )
13+ if @options [ :rebase ]
1414 show_help_message ( 'Too many arguments' ) if args . size > 0
1515 else
16- show_help_message ( " Missing SVN_URL parameter" ) if args . empty?
16+ show_help_message ( ' Missing SVN_URL parameter' ) if args . empty?
1717 show_help_message ( 'Too many arguments' ) if args . size > 1
1818 @url = args . first
1919 end
2020 end
2121
2222 def run!
23- if @options . fetch ( :rebase , false )
23+ if @options [ :rebase ]
2424 get_branches
2525 else
2626 clone!
@@ -53,7 +53,7 @@ def parse(args)
5353 opts . separator ''
5454 opts . separator 'Specific options:'
5555
56- opts . on ( '--rebase' , 'Instead of cloning a new project, rebase an existing one against svn ' ) do
56+ opts . on ( '--rebase' , 'Instead of cloning a new project, rebase an existing one against SVN ' ) do
5757 options [ :rebase ] = true
5858 end
5959
@@ -189,7 +189,7 @@ def fix_branches
189189 svn_branches . each do |branch |
190190 branch = branch . strip
191191
192- if @options . fetch ( :rebase , false ) and ( @local . index ( branch ) != nil or branch == 'trunk' )
192+ if @options [ :rebase ] && ( @local . include? ( branch ) || branch == 'trunk' )
193193 branch = 'master' if branch == 'trunk'
194194 run_command ( "git checkout -f #{ branch } " )
195195 run_command ( "git svn rebase" )
@@ -204,7 +204,7 @@ def fix_branches
204204
205205 def fix_trunk
206206 trunk = @remote . find { |b | b . strip == 'trunk' }
207- if trunk and not @options . fetch ( :rebase , false )
207+ if trunk && ! @options [ :rebase ]
208208 run_command ( "git checkout trunk" )
209209 run_command ( "git branch -D master" )
210210 run_command ( "git checkout -f -b master" )
0 commit comments