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
c33c9bf6
Commit
c33c9bf6
authored
May 23, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring CE-EE parity to app/services/projects/destroy_service.rb
parent
a2dbca4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
app/services/projects/destroy_service.rb
app/services/projects/destroy_service.rb
+16
-3
No files found.
app/services/projects/destroy_service.rb
View file @
c33c9bf6
...
...
@@ -51,11 +51,11 @@ module Projects
flush_caches
(
@project
)
unless
mv
_repository
(
removal_path
(
repo_path
),
repo_path
)
unless
rollback
_repository
(
removal_path
(
repo_path
),
repo_path
)
raise_error
(
'Failed to restore project repository. Please contact the administrator.'
)
end
unless
mv
_repository
(
removal_path
(
wiki_path
),
wiki_path
)
unless
rollback
_repository
(
removal_path
(
wiki_path
),
wiki_path
)
raise_error
(
'Failed to restore wiki repository. Please contact the administrator.'
)
end
end
...
...
@@ -84,6 +84,9 @@ module Projects
# Skip repository removal. We use this flag when remove user or group
return
true
if
params
[
:skip_repo
]
==
true
# There is a possibility project does not have repository or wiki
return
true
unless
repo_exists?
(
path
)
new_path
=
removal_path
(
path
)
if
mv_repository
(
path
,
new_path
)
...
...
@@ -98,8 +101,18 @@ module Projects
end
end
def
mv_repository
(
from_path
,
to
_path
)
def
rollback_repository
(
old_path
,
new
_path
)
# There is a possibility project does not have repository or wiki
return
true
unless
repo_exists?
(
old_path
)
mv_repository
(
old_path
,
new_path
)
end
def
repo_exists?
(
path
)
gitlab_shell
.
exists?
(
project
.
repository_storage
,
path
+
'.git'
)
end
def
mv_repository
(
from_path
,
to_path
)
return
true
unless
gitlab_shell
.
exists?
(
project
.
repository_storage
,
from_path
+
'.git'
)
gitlab_shell
.
mv_repository
(
project
.
repository_storage
,
from_path
,
to_path
)
...
...
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