diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-02-22 12:09:27 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-02-22 12:09:27 +0000 |
commit | 011ddb51b40897bc13a75d78c9e992f559cbde48 (patch) | |
tree | d2f25aa76ab1466ecca82d2cf07e3594b8d7addc /lib/api/commits.rb | |
parent | a75cce1febf0403d66631841fff3bfbeefbfe6e3 (diff) | |
parent | eb421c88ee2a57a437b9b14ba7447a04720354ac (diff) | |
download | gitlab-ce-011ddb51b40897bc13a75d78c9e992f559cbde48.tar.gz |
Merge branch 'master' into 'backstage/gb/build-stages-catch-up-migration'
# Conflicts:
# db/schema.rb
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r-- | lib/api/commits.rb | 5 |
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 |