Prevent commit page error if cant collect branches where commit exists

Signed-off-by: Dmytro Zaporozhets's avatarDmitriy Zaporozhets <[email protected]>
parent 4b6c93c1
......@@ -12,7 +12,12 @@ class Projects::CommitController < Projects::ApplicationController
return git_not_found! unless @commit
@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
@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