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
950c8730
Commit
950c8730
authored
Aug 02, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move create_repository back to project model as we can use disk_path and share it
parent
cdafffcf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
app/models/concerns/storage/legacy_project.rb
app/models/concerns/storage/legacy_project.rb
+0
-13
app/models/project.rb
app/models/project.rb
+13
-0
No files found.
app/models/concerns/storage/legacy_project.rb
View file @
950c8730
...
...
@@ -59,18 +59,5 @@ module Storage
Gitlab
::
UploadsTransfer
.
new
.
rename_project
(
path_was
,
path
,
namespace
.
full_path
)
Gitlab
::
PagesTransfer
.
new
.
rename_project
(
path_was
,
path
,
namespace
.
full_path
)
end
def
create_repository
(
force:
false
)
# Forked import is handled asynchronously
return
if
forked?
&&
!
force
if
gitlab_shell
.
add_repository
(
repository_storage_path
,
path_with_namespace
)
repository
.
after_create
true
else
errors
.
add
(
:base
,
'Failed to create repository via gitlab-shell'
)
false
end
end
end
end
app/models/project.rb
View file @
950c8730
...
...
@@ -993,6 +993,19 @@ class Project < ActiveRecord::Base
end
end
def
create_repository
(
force:
false
)
# Forked import is handled asynchronously
return
if
forked?
&&
!
force
if
gitlab_shell
.
add_repository
(
repository_storage_path
,
disk_path
)
repository
.
after_create
true
else
errors
.
add
(
:base
,
'Failed to create repository via gitlab-shell'
)
false
end
end
def
hook_attrs
(
backward:
true
)
attrs
=
{
name:
name
,
...
...
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