From 2b555306a11abdd5836f506f42109014dd7f3654 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 23 Oct 2013 19:29:29 +0300 Subject: [PATCH] Prevent 500 error if cant detect branches for commit --- .../projects/commit/_commit_box.html.haml | 23 ++++++++++--------- .../steps/project/project_merge_requests.rb | 1 - 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index b45847f837e..111446db586 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -39,17 +39,18 @@ - @commit.parents.each do |parent| = link_to parent.id[0...10], project_commit_path(@project, parent) -.commit-info-row - %span.cgray - Exists in - %span - - branch = commit_default_branch(@project, @branches) - = link_to(branch, project_tree_path(@project, branch)) - - if @branches.any? - and in - = link_to("#{pluralize(@branches.count, "other branch")}", "#", class: "js-details-expand") - %span.js-details-contain.hide - = commit_branches_links(@project, @branches) +- if @branches.any? + .commit-info-row + %span.cgray + Exists in + %span + - branch = commit_default_branch(@project, @branches) + = link_to(branch, project_tree_path(@project, branch)) + - if @branches.any? + and in + = link_to("#{pluralize(@branches.count, "other branch")}", "#", class: "js-details-expand") + %span.js-details-contain.hide + = commit_branches_links(@project, @branches) .commit-box %h3.commit-title diff --git a/features/steps/project/project_merge_requests.rb b/features/steps/project/project_merge_requests.rb index 6c794ef8f13..3dc934a6118 100644 --- a/features/steps/project/project_merge_requests.rb +++ b/features/steps/project/project_merge_requests.rb @@ -109,7 +109,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps end And 'I click on the first commit in the merge request' do - click_link merge_request.commits.first.short_id(8) end