Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Cabrera <martin@kisland.com>2017-01-11 01:11:36 +0300
committerMartin Cabrera <martin@kisland.com>2017-01-11 01:15:56 +0300
commit5dc8fe31ba19f321041d2ad5c73765062d41a312 (patch)
tree709b0e13c23963efc955c5fbbe3cd576bc30fcb6 /app/controllers/projects/compare_controller.rb
parent6ff989cd6d8bb35f237bd2fb398c8b2276189f29 (diff)
Fix Compare page throws 500 error when any branch/reference is not selected
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r--app/controllers/projects/compare_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index ec02fc15d35..5f14581ac69 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -25,8 +25,13 @@ class Projects::CompareController < Projects::ApplicationController
end
def create
- redirect_to namespace_project_compare_path(@project.namespace, @project,
+ if params[:from].blank? || params[:to].blank?
+ flash[:alert] = "You must select from & to branches"
+ redirect_to namespace_project_compare_index_path
+ else
+ redirect_to namespace_project_compare_path(@project.namespace, @project,
params[:from], params[:to])
+ end
end
private