Create namespace on username init. Raise exception if project cannot be moved
This commit is contained in:
parent
4023d9f852
commit
d405c8fc60
4 changed files with 21 additions and 8 deletions
|
@ -3,6 +3,8 @@
|
|||
# Used for moving project repositories from one subdir to another
|
||||
module Gitlab
|
||||
class ProjectMover
|
||||
class ProjectMoveError < StandardError; end
|
||||
|
||||
attr_reader :project, :old_dir, :new_dir
|
||||
|
||||
def initialize(project, old_dir, new_dir)
|
||||
|
@ -23,7 +25,9 @@ module Gitlab
|
|||
log_info "Project #{project.name} was moved from #{old_path} to #{new_path}"
|
||||
true
|
||||
else
|
||||
log_info "Error! Project #{project.name} cannot be moved from #{old_path} to #{new_path}"
|
||||
message = "Project #{project.name} cannot be moved from #{old_path} to #{new_path}"
|
||||
log_info "Error! #{message}"
|
||||
raise ProjectMoveError.new(message)
|
||||
false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue