Rewrite and improve git backend logic. Fix project movind. Raise exception to prevent unexpected issues
This commit is contained in:
parent
70bf7f6e19
commit
f5551efdfd
20 changed files with 146 additions and 99 deletions
|
@ -35,6 +35,10 @@ class Namespace < ActiveRecord::Base
|
|||
where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
|
||||
end
|
||||
|
||||
def self.global_id
|
||||
'GLN'
|
||||
end
|
||||
|
||||
def to_param
|
||||
path
|
||||
end
|
||||
|
@ -51,6 +55,9 @@ class Namespace < ActiveRecord::Base
|
|||
def move_dir
|
||||
old_path = File.join(Gitlab.config.git_base_path, path_was)
|
||||
new_path = File.join(Gitlab.config.git_base_path, path)
|
||||
if File.exists?(new_path)
|
||||
raise "Already exists"
|
||||
end
|
||||
system("mv #{old_path} #{new_path}")
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue