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

Discover default branch on project creationg

parent 44ac961b
...@@ -48,6 +48,7 @@ module Projects ...@@ -48,6 +48,7 @@ module Projects
# Import project from cloneable resource # Import project from cloneable resource
if @project.valid? && @project.import_url.present? if @project.valid? && @project.import_url.present?
shell = Gitlab::Shell.new shell = Gitlab::Shell.new
if shell.import_repository(@project.path_with_namespace, @project.import_url) if shell.import_repository(@project.path_with_namespace, @project.import_url)
# We should create satellite for imported repo # We should create satellite for imported repo
@project.satellite.create unless @project.satellite.exists? @project.satellite.create unless @project.satellite.exists?
...@@ -58,8 +59,12 @@ module Projects ...@@ -58,8 +59,12 @@ module Projects
end end
end end
if @project.save && !@project.group if @project.save
@project.users_projects.create(project_access: UsersProject::MASTER, user: current_user) unless @project.group
@project.users_projects.create(project_access: UsersProject::MASTER, user: current_user)
end
@project.discover_default_branch
end end
@project @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