Skip to content

Commit ef10085

Browse files
committed
Extracted escape_quotes as a class method since it doesn't rely on state.
This also makes testing a bit easier.
1 parent fe4e988 commit ef10085

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/svn2git/migration.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ def parse(args)
145145
options
146146
end
147147

148+
def self.escape_quotes(str)
149+
str.gsub("'", "'\\\\''")
150+
end
151+
152+
def escape_quotes(str)
153+
Svn2Git::Migration.escape_quotes(str)
154+
end
155+
148156
private
149157

150158
def clone!
@@ -374,10 +382,6 @@ def verify_working_tree_is_clean
374382
end
375383
end
376384

377-
def escape_quotes(str)
378-
str.gsub("'", "'\\\\''")
379-
end
380-
381385
def git_config_command
382386
if @git_config_command.nil?
383387
status = run_command('git config --local --get user.name', false)

0 commit comments

Comments
 (0)