Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure the working tree is clean before doing a rebase.

  • Loading branch information...
commit a43b0e78ce7bc21fc9b663c3c4e9e89cf61f7cb9 1 parent 09e6d3a
@nirvdrum nirvdrum authored
Showing with 13 additions and 0 deletions.
  1. +4 −0 lib/svn2git/blah.rb
  2. +9 −0 lib/svn2git/migration.rb
View
4 lib/svn2git/blah.rb
@@ -0,0 +1,4 @@
+require 'migration'
+
+migration = Svn2Git::Migration.new(ARGV)
+migration.run!
View
9 lib/svn2git/migration.rb
@@ -12,6 +12,7 @@ def initialize(args)
@options = parse(args)
if @options[:rebase]
show_help_message('Too many arguments') if args.size > 0
+ verify_working_tree_is_clean
else
show_help_message('Missing SVN_URL parameter') if args.empty?
show_help_message('Too many arguments') if args.size > 1
@@ -241,6 +242,14 @@ def show_help_message(msg)
puts @opts.help
exit
end
+
+ def verify_working_tree_is_clean
+ status = run_command('git status --porcelain --untracked-files=no')
+ unless status.strip == ''
+ puts 'You have local pending changes. The working tree must be clean in order to continue.'
+ exit
+ end
+ end
def escape_quotes(str)
str.gsub("'", "'\\\\''")
Please sign in to comment.
Something went wrong with that request. Please try again.