Commit 7b3b63d4d49dd5c3876e2f0c02026dd9cb289f32

Authored by François Bobot
1 parent 880fef0d

[API] add parent_ids to specific commit informations

doc/api/repositories.md
... ... @@ -259,7 +259,12 @@ Parameters:
259 259 "title": "Sanitize for network graph",
260 260 "author_name": "randx",
261 261 "author_email": "dmitriy.zaporozhets@gmail.com",
262   - "created_at": "2012-09-20T09:06:12+03:00"
  262 + "created_at": "2012-09-20T09:06:12+03:00",
  263 + "committed_date": "2012-09-20T09:06:12+03:00",
  264 + "authored_date": "2012-09-20T09:06:12+03:00",
  265 + "parent_ids" : [
  266 + "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
  267 + ]
263 268 }
264 269 ```
265 270  
... ...
lib/api/entities.rb
... ... @@ -91,6 +91,10 @@ module API
91 91 expose :id, :short_id, :title, :author_name, :author_email, :created_at
92 92 end
93 93  
  94 + class RepoCommitDetail < RepoCommit
  95 + expose :parent_ids, :committed_date, :authored_date
  96 + end
  97 +
94 98 class ProjectSnippet < Grape::Entity
95 99 expose :id, :title, :file_name
96 100 expose :author, using: Entities::UserBasic
... ...
lib/api/repositories.rb
... ... @@ -110,7 +110,7 @@ module API
110 110 sha = params[:sha]
111 111 commit = user_project.repository.commit(sha)
112 112 not_found! "Commit" unless commit
113   - present commit, with: Entities::RepoCommit
  113 + present commit, with: Entities::RepoCommitDetail
114 114 end
115 115  
116 116 # Get the diff for a specific commit of a project
... ...