Discover default branch on project creationg
This commit is contained in:
parent
44ac961b8d
commit
5f0b50db7a
|
|
@ -48,6 +48,7 @@ module Projects
|
|||
# Import project from cloneable resource
|
||||
if @project.valid? && @project.import_url.present?
|
||||
shell = Gitlab::Shell.new
|
||||
|
||||
if shell.import_repository(@project.path_with_namespace, @project.import_url)
|
||||
# We should create satellite for imported repo
|
||||
@project.satellite.create unless @project.satellite.exists?
|
||||
|
|
@ -58,8 +59,12 @@ module Projects
|
|||
end
|
||||
end
|
||||
|
||||
if @project.save && !@project.group
|
||||
@project.users_projects.create(project_access: UsersProject::MASTER, user: current_user)
|
||||
if @project.save
|
||||
unless @project.group
|
||||
@project.users_projects.create(project_access: UsersProject::MASTER, user: current_user)
|
||||
end
|
||||
|
||||
@project.discover_default_branch
|
||||
end
|
||||
|
||||
@project
|
||||
|
|
|
|||
Loading…
Reference in New Issue