[BUG] Lock icon does not show for exclusive file locks in tree view in CE

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

Currently, when a file has exclusive file lock applied in GitLab Community Edition (CE), the lock icon (🔒) is not displayed next to the file in the tree view, unlike in Enterprise Edition (EE) with file locked via UI. This creates inconsistency between editions and fails to provide visual feedback about the locked status of files in CE.

Further details about current conditions

As confirmed in the related issue (#224475 (comment 2404218837)), there is partial support for file locking in CE:

  • Users can edit .gitattributes file or use command line to set up locks
  • Users can lock/unlock files using command line
  • The lock icon is not shown next to locked files in the tree view
CE EE
Arc 2025-03-18 21.17.21.png CleanShot 2025-03-18 at 20.51.08.png

The code investigation reveals:

Acceptance criteria

  • Lock icon appears next to exclusively locked files in the tree view in CE
  • Hovering over the lock icon shows a tooltip with "File locked" or "File locked by [username]" (if possible)
  • The implementation maintains all existing functionality in EE

Related issues

Edited by 🤖 GitLab Bot 🤖