Skip to content

Commit

Permalink
change precedence in git_link_tag, and cover all with begin/rescue #1315
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Jan 12, 2023
1 parent de07846 commit 11acb19
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/helpers/admin_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ def admin_dropdown_setting(name, option_tags, title, description = nil, options
end

def git_link_tag
if Seek::Version.git_present?
begin
begin
if Seek::Version.git_version_record_present?
version = Seek::Version.git_version
link = link_to(version[0...7], "https://github.com/seek4science/seek/commit/#{version}", target: '_blank', title: version).html_safe
"Git revision: #{link}".html_safe
elsif Seek::Version.git_present?
version = Seek::Version.git_version
branch = Seek::Version.git_branch
link = link_to(version[0...7], "https://github.com/seek4science/seek/commit/#{version}", target: '_blank', title: version).html_safe
"Git revision: #{link} (branch: #{branch})".html_safe
rescue
end
elsif Seek::Version.git_version_record_present?
version = Seek::Version.git_version
link = link_to(version[0...7], "https://github.com/seek4science/seek/commit/#{version}", target: '_blank', title: version).html_safe
"Git revision: #{link}".html_safe
rescue
end
end

Expand Down

0 comments on commit 11acb19

Please sign in to comment.