Skip to content

Draft: View correct content when blob is a symlink

Joe Woodward requested to merge feature/show_link_file_content into master

What does this MR do and why?

This is the continuation of a Community contribution Support for displaying soft link file content (!59108 - closed)

View correct content when blob is a symlink

When we create a symlink, git stores this as a blob with mode 120000 and the data will be the path to the linked file.

Prior to this change we would render the path to the linked file in the UI when it would make more sense to render the linked file.

Now when we visit a symlink we see the correct content e.g.

blob_a is README.md blob_b is a symlink to ./README.md

Viewing blob_b now displays the contents of README.md from blob_a.

Changelog: added

Co-authored-by: Joe Woodward jwoodward@gitlab.com

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image
image image

How to set up and validate locally

NOTE: Banzai caches the rendering so you can either clear you cache between tests or add false && to Banzai::Renderer line 23.

      if false && cache_key
  1. Create a symlinked file
  2. Push to GDK
  3. View file

Should now see the actual file rather than the file path that is linked.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Joe Woodward

Merge request reports