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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
ff35b37f
Commit
ff35b37f
authored
Mar 25, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transfer also wiki repository when transfer a project
parent
1fb99264
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
app/services/project_transfer_service.rb
app/services/project_transfer_service.rb
+8
-2
No files found.
app/services/project_transfer_service.rb
View file @
ff35b37f
...
...
@@ -5,6 +5,8 @@
class
ProjectTransferService
include
Gitlab
::
ShellAdapter
class
TransferError
<
StandardError
;
end
attr_accessor
:project
def
transfer
(
project
,
new_namespace
)
...
...
@@ -19,14 +21,18 @@ class ProjectTransferService
project
.
namespace
=
new_namespace
project
.
save!
# Move main repository
unless
gitlab_shell
.
mv_repository
(
old_path
,
new_path
)
raise
TransferError
.
new
(
'Cannot move project'
)
end
# Move wiki repo also if present
if
project
.
wikis
.
any?
gitlab_shell
.
mv_repository
(
"
#{
old_path
}
.wiki"
,
"
#{
new_path
}
.wiki"
)
end
true
end
rescue
=>
ex
raise
Project
::
TransferError
.
new
(
ex
.
message
)
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