Prevent 500 after merge MR if you check remove source branch

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-12-23 11:22:12 +02:00
parent f3d7bf63f1
commit 90ed76ac3c
No known key found for this signature in database
GPG key ID: 161B5D6A44D3D88A

View file

@ -66,7 +66,14 @@ module TreeHelper
end end
def edit_blob_link(project, ref, path, options = {}) def edit_blob_link(project, ref, path, options = {})
if project.repository.blob_at(ref, path).text? blob =
begin
project.repository.blob_at(ref, path)
rescue
nil
end
if blob && blob.text?
text = 'Edit' text = 'Edit'
after = options[:after] || '' after = options[:after] || ''
from_mr = options[:from_merge_request_id] from_mr = options[:from_merge_request_id]