summaryrefslogtreecommitdiff
path: root/lib/api/commits.rb
diff options
context:
space:
mode:
authorMaxime Roussin-Belanger <maxime.roussinbelanger@gmail.com>2018-02-18 22:17:23 -0500
committerMaxime Roussin-Belanger <maxime.roussinbelanger@gmail.com>2018-02-19 20:09:03 -0500
commit0dafea8685f0376d4c474f7670a97d0b8e449767 (patch)
tree22e79e6f23ff7be5e036764a2102ed3c09f70b0a /lib/api/commits.rb
parentcd82683e79e3c1cffe28ff1cf458ee8d84577e69 (diff)
downloadgitlab-ce-0dafea8685f0376d4c474f7670a97d0b8e449767.tar.gz
Add missing pagination on the commit diff endpoint
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r--lib/api/commits.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index d83c43ee49b..3d6e78d2d80 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -97,13 +97,16 @@ module API
end
params do
requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag'
+ use :pagination
end
get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do
commit = user_project.commit(params[:sha])
not_found! 'Commit' unless commit
- present commit.raw_diffs.to_a, with: Entities::Diff
+ raw_diffs = ::Kaminari.paginate_array(commit.raw_diffs.to_a)
+
+ present paginate(raw_diffs), with: Entities::Diff
end
desc "Get a commit's comments" do