Skip to content

Instantly share code, notes, and snippets.

@bhgraham
Created February 14, 2013 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhgraham/4951480 to your computer and use it in GitHub Desktop.
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.
# 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