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:
parent
f3d7bf63f1
commit
90ed76ac3c
1 changed files with 8 additions and 1 deletions
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue