diff options
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r-- | app/helpers/commits_helper.rb | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index f75d3657986..ee86553d75d 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -27,12 +27,11 @@ module CommitsHelper end def commit_to_html(commit, ref, project) - render partial: 'projects/commits/commit', formats: :html, - locals: { - commit: commit, - ref: ref, - project: project - } + render partial: 'projects/commits/commit', formats: :html, locals: { + commit: commit, + ref: ref, + project: project + } end # Breadcrumb links for a Project and, if applicable, a tree path @@ -170,7 +169,8 @@ module CommitsHelper pipeline_status: commit.detailed_status_for(ref)&.cache_key, xhr: request.xhr?, controller: controller.controller_path, - path: @path # referred to in #link_to_browse_code + path: @path, # referred to in #link_to_browse_code + referenced_by: tag_checksum(commit.referenced_by) } ] end @@ -188,16 +188,22 @@ module CommitsHelper entity = mode == 'raw' ? 'rawButton' : 'renderedButton' title = "Display #{mode} diff" - link_to("##{mode}-diff-#{file_hash}", - class: "btn gl-button btn-default btn-file-option has-tooltip btn-show-#{mode}-diff", - title: title, - data: { file_hash: file_hash, diff_toggle_entity: entity }) do + link_to( + "##{mode}-diff-#{file_hash}", + class: "btn gl-button btn-default btn-file-option has-tooltip btn-show-#{mode}-diff", + title: title, + data: { file_hash: file_hash, diff_toggle_entity: entity } + ) do sprite_icon(icon) end end protected + def tag_checksum(tags_array) + ::Zlib.crc32(tags_array.sort.join) + end + # Private: Returns a link to a person. If the person has a matching user and # is a member of the current @project it will link to the team member page. # Otherwise it will link to the person email as specified in the commit. |