Skip to content
Snippets Groups Projects
Commit 5f0b50db authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Discover default branch on project creationg

parent 44ac961b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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?
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment