summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-08-21 14:48:35 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-08-21 14:49:36 +0100
commit5b037d5cc339b95a6ce43ff1b518946ed1cb0b6f (patch)
tree209255ff46e620e5b893118dac9a7d95389f2e3f /lib
parent7d0a1220f145b8c6b502486fa370e01c62d1aa2b (diff)
downloadgitlab-ci-5b037d5cc339b95a6ce43ff1b518946ed1cb0b6f.tar.gz
API for trigger when requested returns trigger request with commit information, but without the created builds
Diffstat (limited to 'lib')
-rw-r--r--lib/api/commits.rb4
-rw-r--r--lib/api/entities.rb3
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index 6aa060c..363e5d7 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -15,7 +15,7 @@ module API
authenticate_project_token!(project)
commits = project.commits.page(params[:page]).per(params[:per_page] || 20)
- present commits, with: Entities::Commit
+ present commits, with: Entities::CommitWithBuilds
end
# Create a commit
@@ -53,7 +53,7 @@ module API
commit = CreateCommitService.new.execute(project, params[:data])
if commit.persisted?
- present commit, with: Entities::Commit
+ present commit, with: Entities::CommitWithBuilds
else
errors = commit.errors.full_messages.join(", ")
render_api_error!(errors, 400)
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 3423f4a..3aaef0a 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -4,6 +4,9 @@ module API
expose :id, :ref, :sha, :project_id, :before_sha, :created_at
expose :status, :finished_at, :duration
expose :git_commit_message, :git_author_name, :git_author_email
+ end
+
+ class CommitWithBuilds < Commit
expose :builds
end