diff --git a/app/models/blob.rb b/app/models/blob.rb index 874bf58530e52f2dc407ee1d46a408db6502dc12..8a9db8b45ea220e0b2b5214471fbaf8d3dbe55de 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -6,6 +6,8 @@ class Blob < SimpleDelegator include BlobLanguageFromGitAttributes include BlobActiveModel + MODE_SYMLINK = '120000' # The STRING 120000 is the git-reported octal filemode for a symlink + CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute CACHE_TIME_IMMUTABLE = 3600 # Cache blobs referred to by an immutable reference for 1 hour diff --git a/app/views/projects/blob/_header_content.html.haml b/app/views/projects/blob/_header_content.html.haml index 32adfb320ffe23c02ce315c86e0b5f345b6a9182..303563489418f0c617236309add2bb0311db2eeb 100644 --- a/app/views/projects/blob/_header_content.html.haml +++ b/app/views/projects/blob/_header_content.html.haml @@ -7,6 +7,8 @@ = copy_file_path_button(blob.path) %small.mr-1 + - if blob.mode == Blob::MODE_SYMLINK + = _('Symbolic link') << ' ยท' = number_to_human_size(blob.raw_size) - if blob.stored_externally? && blob.external_storage == :lfs diff --git a/changelogs/unreleased/feature-symlink-blob-label.yml b/changelogs/unreleased/feature-symlink-blob-label.yml new file mode 100644 index 0000000000000000000000000000000000000000..16319d93ff955ab49d0e9ccc57a49626d118ad04 --- /dev/null +++ b/changelogs/unreleased/feature-symlink-blob-label.yml @@ -0,0 +1,5 @@ +--- +title: Add symlink label text to blob viewer +merge_request: 38220 +author: +type: added diff --git a/locale/gitlab.pot b/locale/gitlab.pot index e287cd9d8cb1f483db5091b46af017fd82c80219..4476d6aef2efe734d8cac8dcfbfd44e5ba80fa40 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -23554,6 +23554,9 @@ msgstr "" msgid "Switch to the source to copy the file contents" msgstr "" +msgid "Symbolic link" +msgstr "" + msgid "Sync information" msgstr ""