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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
5f0b50db
Commit
5f0b50db
authored
Jul 04, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Discover default branch on project creationg
parent
44ac961b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
app/contexts/projects/create_context.rb
app/contexts/projects/create_context.rb
+7
-2
No files found.
app/contexts/projects/create_context.rb
View file @
5f0b50db
...
...
@@ -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,10 +59,14 @@ module Projects
end
end
if
@project
.
save
&&
!
@project
.
group
if
@project
.
save
unless
@project
.
group
@project
.
users_projects
.
create
(
project_access:
UsersProject
::
MASTER
,
user:
current_user
)
end
@project
.
discover_default_branch
end
@project
rescue
=>
ex
@project
.
errors
.
add
(
:base
,
"Can't save project. Please try again later"
)
...
...
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