diff --git a/doc/api/repositories.md b/doc/api/repositories.md index 6b3a43b869e..35f7ad7ae95 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -259,7 +259,12 @@ Parameters: "title": "Sanitize for network graph", "author_name": "randx", "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" + ] } ``` diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 7daf8ace242..8d2f38c4daa 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -91,6 +91,10 @@ module API expose :id, :short_id, :title, :author_name, :author_email, :created_at end + class RepoCommitDetail < RepoCommit + expose :parent_ids, :committed_date, :authored_date + end + class ProjectSnippet < Grape::Entity expose :id, :title, :file_name expose :author, using: Entities::UserBasic diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index 0a32135ff10..c99c8f7bdfb 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -112,7 +112,7 @@ module API sha = params[:sha] commit = user_project.repository.commit(sha) not_found! "Commit" unless commit - present commit, with: Entities::RepoCommit + present commit, with: Entities::RepoCommitDetail end # Get the diff for a specific commit of a project