Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
3f1d6d6a
Commit
3f1d6d6a
authored
Nov 24, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move namespace dir after path changed
parent
f37fa968
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
app/models/namespace.rb
app/models/namespace.rb
+8
-1
No files found.
app/models/namespace.rb
View file @
3f1d6d6a
...
@@ -12,7 +12,8 @@ class Namespace < ActiveRecord::Base
...
@@ -12,7 +12,8 @@ class Namespace < ActiveRecord::Base
delegate
:name
,
to: :owner
,
allow_nil:
true
,
prefix:
true
delegate
:name
,
to: :owner
,
allow_nil:
true
,
prefix:
true
after_save
:ensure_dir_exist
after_create
:ensure_dir_exist
after_update
:move_dir
scope
:root
,
where
(
'type IS NULL'
)
scope
:root
,
where
(
'type IS NULL'
)
...
@@ -32,4 +33,10 @@ class Namespace < ActiveRecord::Base
...
@@ -32,4 +33,10 @@ class Namespace < ActiveRecord::Base
namespace_dir_path
=
File
.
join
(
Gitlab
.
config
.
git_base_path
,
path
)
namespace_dir_path
=
File
.
join
(
Gitlab
.
config
.
git_base_path
,
path
)
Dir
.
mkdir
(
namespace_dir_path
)
unless
File
.
exists?
(
namespace_dir_path
)
Dir
.
mkdir
(
namespace_dir_path
)
unless
File
.
exists?
(
namespace_dir_path
)
end
end
def
move_dir
old_path
=
File
.
join
(
Gitlab
.
config
.
git_base_path
,
path_was
)
new_path
=
File
.
join
(
Gitlab
.
config
.
git_base_path
,
path
)
system
(
"mv
#{
old_path
}
#{
new_path
}
"
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment