Skip to content

Commit f29890d

Browse files
committed
Add support for --password option
1 parent 21ace8b commit f29890d

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
@@ -52,6 +52,7 @@ def parse(args)
5252
options[:exclude] = []
5353
options[:revision] = nil
5454
options[:username] = nil
55+
options[:password] = nil
5556
options[:rebasebranch] = false
5657

5758
if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
@@ -74,6 +75,10 @@ def parse(args)
7475
options[:username] = username
7576
end
7677

78+
opts.on('--password PASSWORD', 'Password for transports that need it (http(s), svn)') do |password|
79+
options[:password] = password
80+
end
81+
7782
opts.on('--trunk TRUNK_PATH', 'Subpath to trunk from repository URL (default: trunk)') do |trunk|
7883
options[:trunk] = trunk
7984
end
@@ -172,11 +177,13 @@ def clone!
172177
exclude = @options[:exclude]
173178
revision = @options[:revision]
174179
username = @options[:username]
180+
password = @options[:password]
175181

176182
if rootistrunk
177183
# Non-standard repository layout. The repository root is effectively 'trunk.'
178184
cmd = "git svn init --prefix=svn/ "
179185
cmd += "--username=#{username} " unless username.nil?
186+
cmd += "--password=#{password} " unless password.nil?
180187
cmd += "--no-metadata " unless metadata
181188
if nominimizeurl
182189
cmd += "--no-minimize-url "
@@ -189,6 +196,7 @@ def clone!
189196

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

0 commit comments

Comments
 (0)