Commit 1c0929f5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #5823 from bobot/feature/api_parent_ids

[API] add parent_ids to specific commit informations
parents 354a2854 7b3b63d4
...@@ -259,7 +259,12 @@ Parameters: ...@@ -259,7 +259,12 @@ Parameters:
"title": "Sanitize for network graph", "title": "Sanitize for network graph",
"author_name": "randx", "author_name": "randx",
"author_email": "dmitriy.zaporozhets@gmail.com", "author_email": "dmitriy.zaporozhets@gmail.com",
"created_at": "2012-09-20T09:06:12+03:00" "created_at": "2012-09-20T09:06:12+03:00",
"committed_date": "2012-09-20T09:06:12+03:00",
"authored_date": "2012-09-20T09:06:12+03:00",
"parent_ids" : [
"ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
]
} }
``` ```
......
...@@ -91,6 +91,10 @@ module API ...@@ -91,6 +91,10 @@ module API
expose :id, :short_id, :title, :author_name, :author_email, :created_at expose :id, :short_id, :title, :author_name, :author_email, :created_at
end end
class RepoCommitDetail < RepoCommit
expose :parent_ids, :committed_date, :authored_date
end
class ProjectSnippet < Grape::Entity class ProjectSnippet < Grape::Entity
expose :id, :title, :file_name expose :id, :title, :file_name
expose :author, using: Entities::UserBasic expose :author, using: Entities::UserBasic
......
...@@ -112,7 +112,7 @@ module API ...@@ -112,7 +112,7 @@ module API
sha = params[:sha] sha = params[:sha]
commit = user_project.repository.commit(sha) commit = user_project.repository.commit(sha)
not_found! "Commit" unless commit not_found! "Commit" unless commit
present commit, with: Entities::RepoCommit present commit, with: Entities::RepoCommitDetail
end end
# Get the diff for a specific commit of a project # Get the diff for a specific commit of a 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