Commit e740a00e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Prevent commit page error if cant collect branches where commit exists

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4b6c93c1
...@@ -12,7 +12,12 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -12,7 +12,12 @@ class Projects::CommitController < Projects::ApplicationController
return git_not_found! unless @commit return git_not_found! unless @commit
@line_notes = project.notes.for_commit_id(commit.id).inline @line_notes = project.notes.for_commit_id(commit.id).inline
@branches = project.repository.branch_names_contains(commit.id)
@branches = begin
project.repository.branch_names_contains(commit.id)
rescue Grit::Git::GitTimeout
[]
end
begin begin
@suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff] @suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff]
......
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