Commit e740a00ed659221929a79e580634424423690514

Authored by Dmitriy Zaporozhets
1 parent 4b6c93c1

Prevent commit page error if cant collect branches where commit exists

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
app/controllers/projects/commit_controller.rb
... ... @@ -12,7 +12,12 @@ class Projects::CommitController &lt; Projects::ApplicationController
12 12 return git_not_found! unless @commit
13 13  
14 14 @line_notes = project.notes.for_commit_id(commit.id).inline
15   - @branches = project.repository.branch_names_contains(commit.id)
  15 +
  16 + @branches = begin
  17 + project.repository.branch_names_contains(commit.id)
  18 + rescue Grit::Git::GitTimeout
  19 + []
  20 + end
16 21  
17 22 begin
18 23 @suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff]
... ...