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
Boxiang Sun
gitlab-ce
Commits
3962c725
Commit
3962c725
authored
Dec 18, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update storage location after a project has been renamed
parent
a0222cf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
app/services/projects/after_rename_service.rb
app/services/projects/after_rename_service.rb
+1
-0
spec/services/projects/after_rename_service_spec.rb
spec/services/projects/after_rename_service_spec.rb
+20
-0
No files found.
app/services/projects/after_rename_service.rb
View file @
3962c725
...
...
@@ -81,6 +81,7 @@ module Projects
def
update_repository_configuration
project
.
reload_repository!
project
.
write_repository_config
project
.
track_project_repository
end
def
rename_transferred_documents
...
...
spec/services/projects/after_rename_service_spec.rb
View file @
3962c725
...
...
@@ -99,6 +99,17 @@ describe Projects::AfterRenameService do
expect
(
rugged_config
[
'gitlab.fullpath'
]).
to
eq
(
project
.
full_path
)
end
it
'updates storage location'
do
allow
(
project_storage
).
to
receive
(
:rename_repo
).
and_return
(
true
)
described_class
.
new
(
project
).
execute
expect
(
project
.
project_repository
).
to
have_attributes
(
disk_path:
project
.
disk_path
,
shard_name:
project
.
repository_storage
)
end
end
context
'using hashed storage'
do
...
...
@@ -193,6 +204,15 @@ describe Projects::AfterRenameService do
expect
(
rugged_config
[
'gitlab.fullpath'
]).
to
eq
(
project
.
full_path
)
end
it
'updates storage location'
do
described_class
.
new
(
project
).
execute
expect
(
project
.
project_repository
).
to
have_attributes
(
disk_path:
project
.
disk_path
,
shard_name:
project
.
repository_storage
)
end
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