Created
February 14, 2013 09:09
-
-
Save bhgraham/4951480 to your computer and use it in GitHub Desktop.
gitlab/lib/api/projects.rb only changed the lines mentioning namespace_id. these were added to allow project creation within namespace (from API).
If not used, it defaults to your username. This allows gh2gl to work "git clone http://code.a8.lc/administr8/github2gitlab.git" for github to gitlab migrations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create new project | |
# | |
# Parameters: | |
# name (required) - name for new project | |
# description (optional) - short project description | |
# default_branch (optional) - 'master' by default | |
# issues_enabled (optional) - enabled by default | |
# wall_enabled (optional) - enabled by default | |
# merge_requests_enabled (optional) - enabled by default | |
# wiki_enabled (optional) - enabled by default | |
# Example Request | |
# POST /projects | |
post do | |
attrs = attributes_for_keys [:name, | |
:description, | |
:default_branch, | |
:issues_enabled, | |
:wall_enabled, | |
:merge_requests_enabled, | |
:wiki_enabled, | |
:namespace_id] | |
@project = Project.create_by_user(attrs, current_user) | |
if @project.saved? | |
present @project, with: Entities::Project | |
else | |
not_found! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment