Project can be transfered to namespace and out now
This commit is contained in:
parent
d405c8fc60
commit
f997947664
3 changed files with 16 additions and 13 deletions
|
@ -1,14 +1,5 @@
|
|||
class ProjectObserver < ActiveRecord::Observer
|
||||
def after_save(project)
|
||||
# Move repository if namespace changed
|
||||
if project.namespace_id_changed? and not project.new_record?
|
||||
old_dir = Namespace.find_by_id(project.namespace_id_was).try(:path) || ''
|
||||
new_dir = Namespace.find_by_id(project.namespace_id).try(:path) || ''
|
||||
|
||||
Gitlab::ProjectMover.new(project, old_dir, new_dir).execute
|
||||
end
|
||||
|
||||
# Update gitolite
|
||||
project.update_repository
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue