lib/braid/commands/setup.rb in braid-0.7.0 vs lib/braid/commands/setup.rb in braid-0.7.1
- old
+ new
@@ -16,11 +16,16 @@
def setup_one(path)
mirror = config.get!(path)
if git.remote_url(mirror.remote)
- msg "Setup: Mirror '#{mirror.path}' already has a remote. Reusing it." if verbose?
- return
+ if force?
+ msg "Setup: Mirror '#{mirror.path}' already has a remote. Replacing it (force)" if verbose?
+ git.remote_rm(mirror.remote)
+ else
+ msg "Setup: Mirror '#{mirror.path}' already has a remote. Reusing it." if verbose?
+ return
+ end
end
msg "Setup: Creating remote for '#{mirror.path}'."
unless mirror.type == "svn"
url = use_local_cache? ? git_cache.path(mirror.url) : mirror.url