Rewrite and improve git backend logic. Fix project movind. Raise exception to prevent unexpected issues

This commit is contained in:
Dmitriy Zaporozhets 2012-11-27 09:31:15 +03:00
parent 70bf7f6e19
commit f5551efdfd
20 changed files with 146 additions and 99 deletions

View file

@ -21,6 +21,10 @@ module Gitlab
old_path = File.join(Gitlab.config.git_base_path, old_dir, "#{project.path}.git")
new_path = File.join(new_dir_path, "#{project.path}.git")
if File.exists? new_path
raise ProjectMoveError.new("Destination #{new_path} already exists")
end
if system("mv #{old_path} #{new_path}")
log_info "Project #{project.name} was moved from #{old_path} to #{new_path}"
true