diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-01 17:31:35 +0300 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-03 15:13:11 +0300 |
commit | cd88fa8f80710ec977a85ab8701570073c94f017 (patch) | |
tree | 8866f616741d7a3f7f35f6e37b2e01503804b2a2 /app/controllers/projects/merge_requests | |
parent | 8c01f3110c8d8601fc16b17850dfa778f1f3d877 (diff) |
removed the #ensure_ref_fetched from all controllers
also, I refactored the MergeRequest#fetch_ref method to express
the side-effect that this method has.
MergeRequest#fetch_ref -> MergeRequest#fetch_ref!
Repository#fetch_source_branch -> Repository#fetch_source_branch!
Diffstat (limited to 'app/controllers/projects/merge_requests')
-rw-r--r-- | app/controllers/projects/merge_requests/application_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests/creations_controller.rb | 1 |
2 files changed, 0 insertions, 8 deletions
diff --git a/app/controllers/projects/merge_requests/application_controller.rb b/app/controllers/projects/merge_requests/application_controller.rb index 0e71977a58a..1269759fc2b 100644 --- a/app/controllers/projects/merge_requests/application_controller.rb +++ b/app/controllers/projects/merge_requests/application_controller.rb @@ -2,7 +2,6 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont before_action :check_merge_requests_available! before_action :merge_request before_action :authorize_read_merge_request! - before_action :ensure_ref_fetched private @@ -10,12 +9,6 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont @issuable = @merge_request ||= @project.merge_requests.find_by!(iid: params[:id]) end - # Make sure merge requests created before 8.0 - # have head file in refs/merge-requests/ - def ensure_ref_fetched - @merge_request.ensure_ref_fetched if Gitlab::Database.read_write? - end - def merge_request_params params.require(:merge_request).permit(merge_request_params_attributes) end diff --git a/app/controllers/projects/merge_requests/creations_controller.rb b/app/controllers/projects/merge_requests/creations_controller.rb index 99dc3dda9e7..129682f64aa 100644 --- a/app/controllers/projects/merge_requests/creations_controller.rb +++ b/app/controllers/projects/merge_requests/creations_controller.rb @@ -4,7 +4,6 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap include RendersCommits skip_before_action :merge_request - skip_before_action :ensure_ref_fetched before_action :authorize_create_merge_request! before_action :apply_diff_view_cookie!, only: [:diffs, :diff_for_path] before_action :build_merge_request, except: [:create] |