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:
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r--app/controllers/projects/compare_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index 28a87f83451..edf45e7063a 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -79,11 +79,11 @@ class Projects::CompareController < Projects::ApplicationController
private
def validate_refs!
- valid = [head_ref, start_ref].map { |ref| valid_ref?(ref) }
+ invalid = [head_ref, start_ref].filter { |ref| !valid_ref?(ref) }
- return if valid.all?
+ return if invalid.empty?
- flash[:alert] = "Invalid branch name"
+ flash[:alert] = "Invalid branch name(s): #{invalid.join(', ')}"
redirect_to project_compare_index_path(source_project)
end