Commit 98416ec9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show proper message for new MR when satellite fails

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c827af21
......@@ -74,9 +74,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.source_branch
)
@compare_failed = false
@commits = compare_action.commits
if @commits
@commits.map! { |commit| Commit.new(commit) }
@commit = @commits.first
else
# false value because failed to get commits from satellite
@commits = []
@compare_failed = true
end
@diffs = compare_action.diffs
@merge_request.title = @merge_request.source_branch.titleize.humanize
......
......@@ -33,6 +33,11 @@
%div= msg
- if @merge_request.source_branch.present? && @merge_request.target_branch.present?
- if @compare_failed
.alert.alert-danger
%h4 Compare failed
%p We can't compare selected branches. It may be because of huge diff or satellite timeout. Please try again or select different branches.
- else
.light-well
%center
%h4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment