Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit bc5df18

Browse files
committed
Added password support via the --password command line option
1 parent 9f8b3e1 commit bc5df18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/svn2git/migration.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def parse(args)
4646
options[:exclude] = []
4747
options[:revision] = nil
4848
options[:username] = nil
49+
options[:password] = nil
4950
options[:clone] = true
5051
options[:bare] = false
5152
options[:repository] = '';
@@ -77,6 +78,10 @@ def parse(args)
7778
opts.on('--username NAME', 'Username for transports that needs it (http(s), svn)') do |username|
7879
options[:username] = username
7980
end
81+
82+
opts.on('--password PASSWORD', 'Password for transports that needs it (http(s), svn)') do |password|
83+
options[:password] = password
84+
end
8085

8186
opts.on('--trunk TRUNK_PATH', 'Subpath to trunk from repository URL (default: trunk)') do |trunk|
8287
options[:trunk] = trunk
@@ -164,6 +169,7 @@ def clone!
164169
exclude = @options[:exclude]
165170
revision = @options[:revision]
166171
username = @options[:username]
172+
password = @options[:password]
167173
repos = @options[:repository]
168174

169175
cmd = "git "
@@ -178,6 +184,7 @@ def clone!
178184
# Non-standard repository layout. The repository root is effectively 'trunk.'
179185
cmd += "svn init --prefix=svn/ "
180186
cmd += "--username=#{username} " unless username.nil?
187+
cmd += "--password=#{password} " unless password.nil?
181188
cmd += "--no-metadata " unless metadata
182189
if nominimizeurl
183190
cmd += "--no-minimize-url "
@@ -190,6 +197,7 @@ def clone!
190197

191198
# Add each component to the command that was passed as an argument.
192199
cmd += "--username=#{username} " unless username.nil?
200+
cmd += "--password=#{password} " unless password.nil?
193201
cmd += "--no-metadata " unless metadata
194202
if nominimizeurl
195203
cmd += "--no-minimize-url "

0 commit comments

Comments
 (0)