summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-08-10 14:49:27 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-10 14:49:27 +0200
commit27276c550450fb8e384bff8a839ba974c016ac83 (patch)
treec1555fb40afd9af9f419ca2a11379dc8c2d3dfe4
parent023d4812586faa24cce69715c606b4bf236956e9 (diff)
downloadgitlab-ce-merge_requests_new_cleanup_variables.tar.gz
Remove controller instance variables that are in the mergerequestmerge_requests_new_cleanup_variables
-rw-r--r--app/controllers/projects/merge_requests_controller.rb8
-rw-r--r--app/views/projects/merge_requests/_new_compare.html.haml6
-rw-r--r--app/views/shared/issuable/_form.html.haml2
3 files changed, 4 insertions, 12 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 2cf6a2dd1b3..cc839603655 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -145,14 +145,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
build_merge_request
@noteable = @merge_request
- @target_branches = if @merge_request.target_project
- @merge_request.target_project.repository.branch_names
- else
- []
- end
-
- @target_project = merge_request.target_project
- @source_project = merge_request.source_project
@commits = @merge_request.compare_commits.reverse
@commit = @merge_request.diff_head_commit
@base_commit = @merge_request.diff_base_commit
diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml
index de39964fca8..e8dab7785f8 100644
--- a/app/views/projects/merge_requests/_new_compare.html.haml
+++ b/app/views/projects/merge_requests/_new_compare.html.haml
@@ -82,7 +82,7 @@
:javascript
new Compare({
- targetProjectUrl: "#{update_branches_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}",
- sourceBranchUrl: "#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}",
- targetBranchUrl: "#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}"
+ targetProjectUrl: "#{update_branches_namespace_project_merge_requests_path(@merge_request.source_project.namespace, @merge_request.source_project)}",
+ sourceBranchUrl: "#{branch_from_namespace_project_merge_requests_path(@merge_request.source_project.namespace, @merge_request.source_project)}",
+ targetBranchUrl: "#{branch_to_namespace_project_merge_requests_path(@merge_request.source_project.namespace, @merge_request.source_project)}"
});
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml
index c30bdb0ae91..b6e1b13966e 100644
--- a/app/views/shared/issuable/_form.html.haml
+++ b/app/views/shared/issuable/_form.html.haml
@@ -54,7 +54,7 @@
.issuable-form-select-holder
= users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
placeholder: 'Select assignee', class: 'custom-form-control', null_user: true,
- selected: issuable.assignee_id, project: @target_project || @project,
+ selected: issuable.assignee_id, project: issuable.respond_to?(:target_project) && issuable.target_project || @project,
first_user: true, current_user: true, include_blank: true)
%div
= link_to 'Assign to me', '#', class: 'assign-to-me-link prepend-top-5 inline'