Commit 7901d143153842a1a8b382d16e90a20cf4dd3b36

Authored by Dmitriy Zaporozhets
1 parent 6c345997

Proper erro message for MR when fork removed

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/views/projects/merge_requests/invalid.html.haml
@@ -3,15 +3,21 @@ @@ -3,15 +3,21 @@
3 = render "projects/merge_requests/show/mr_box" 3 = render "projects/merge_requests/show/mr_box"
4 4
5 .alert.alert-error 5 .alert.alert-error
6 - %h5  
7 - %i.icon-exclamation-sign  
8 - We cannot find  
9 - %span.label-branch= @merge_request.source_branch  
10 - or  
11 - %span.label-branch= @merge_request.target_branch  
12 - branches in the repository.  
13 - %p  
14 - Maybe it was removed or never pushed.  
15 %p 6 %p
  7 + We cannot render this merge request properly because
  8 + - if @merge_request.for_fork? && !@merge_request.source_project
  9 + fork project was removed
  10 + - elsif !@merge_request.source_branch_exists?
  11 + %span.label.label-inverse= @merge_request.source_branch
  12 + does not exist in
  13 + %span.label.label-info= @merge_request.source_project_path
  14 + - elsif !@merge_request.target_branch_exists?
  15 + %span.label.label-inverse= @merge_request.target_branch
  16 + does not exist in
  17 + %span.label.label-info= @merge_request.target_project_path
  18 + - else
  19 + of internal error
  20 +
  21 + %strong
16 Please close Merge Request or change branches with existing one 22 Please close Merge Request or change branches with existing one
17 23