Commit 5f0b50db authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Discover default branch on project creationg

parent 44ac961b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment