diff options
author | Patrick Bajao <ebajao@gitlab.com> | 2019-01-25 17:22:48 +0800 |
---|---|---|
committer | Patrick Bajao <ebajao@gitlab.com> | 2019-01-28 15:11:38 +0800 |
commit | 65723a2cb60f46681a766f34102df700ef5b7573 (patch) | |
tree | 26007e09b6dacf3232ba6b09b5d7547f34e4b0b6 /lib | |
parent | 276147c1f6c54ae87941953ec62d0d674c12f462 (diff) | |
download | gitlab-ce-65723a2cb60f46681a766f34102df700ef5b7573.tar.gz |
Modify MergeRequestsFinder to allow filtering by commit
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/commits.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 41cb3e17af8..be682982897 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -323,7 +323,13 @@ module API commit = user_project.commit(params[:sha]) not_found! 'Commit' unless commit - present paginate(commit.merge_requests), with: Entities::MergeRequestBasic + commit_merge_requests = MergeRequestsFinder.new( + current_user, + project_id: user_project.id, + commit_sha: commit.sha + ).execute + + present paginate(commit_merge_requests), with: Entities::MergeRequestBasic end end end |