lib/braid/command.rb in braid-1.0.22 vs lib/braid/command.rb in braid-1.1.0

- old
+ new

@@ -8,11 +8,11 @@ def self.run(command, *args) verify_git_version! check_working_dir! - klass = Commands.const_get(command.to_s.capitalize) + klass = Commands.const_get(command.to_s) klass.new.run(*args) rescue BraidError => error case error when Operations::ShellExecutionError @@ -30,11 +30,11 @@ def msg(str) self.class.msg(str) end def config - @config ||= Config.new + @config ||= Config.new({'mode' => config_mode}) end def verbose? Braid.verbose end @@ -43,15 +43,19 @@ Braid.force end private + def config_mode + Config::MODE_MAY_WRITE + end + def setup_remote(mirror) existing_force = Braid.force begin Braid.force = true - Command.run(:setup, mirror.path) + Command.run(:Setup, mirror.path) ensure Braid.force = existing_force end end @@ -130,12 +134,8 @@ raise InvalidRevision, 'mirror is already at requested revision' end new_revision end - end - - def determine_target_revision(mirror, new_revision) - git.rev_parse(mirror.versioned_path(new_revision)) end end end