From 11acb1928ec2514e6c4401d90ab7860a0651f225 Mon Sep 17 00:00:00 2001 From: Stuart Owen Date: Wed, 11 Jan 2023 15:02:56 +0000 Subject: [PATCH] change precedence in git_link_tag, and cover all with begin/rescue #1315 --- app/helpers/admin_helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 43c0fa68bc..3b8261316c 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -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