Exclusive file locks - bug?
Following discussion from (!39133 (comment 394046522)
When I locked a file with git lfs lock file.png
, it is displayed as locked in the repo > locked files, but the padlock icon doesn't show on the repo files.
Steps to reproduce:
-
Add new img (
random.png
) and push to the repo:➜ lfs-file-locking git:(master) git status On branch master Your branch is up to date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) random.png nothing added to commit but untracked files present (use "git add" to track) ➜ lfs-file-locking git:(master) ✗ git add . ➜ lfs-file-locking git:(master) ✗ git commit -m "Add new img" [master f712c1e] Add new img 1 file changed, 3 insertions(+) create mode 100644 random.png ➜ lfs-file-locking git:(master) git push origin master Uploading LFS objects: 100% (1/1), 21 KB | 0 B/s, done. Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 12 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 1.02 KiB | 1.02 MiB/s, done. Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 To gitlab.com:gitlab-tests/lfs-file-locking.git fa2a627..f712c1e master -> master
-
Check the file in the UI: repo > files:
-
Lock the img locally:
➜ lfs-file-locking git:(master) git lfs lock random.png Locked random.png
-
Check the file in the UI again: there's no padlock:
-
Check repo > locked files: it's listed as locked:
-
When trying to
git push
, Git says:Everything up-to-date
. Nothing changes. So I'll add a new file to trigger the push. -
Add another img (
random1.png
) to the repo:➜ lfs-file-locking git:(master) git status On branch master Your branch is up to date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) random1.png nothing added to commit but untracked files present (use "git add" to track) ➜ lfs-file-locking git:(master) ✗ git add . ➜ lfs-file-locking git:(master) ✗ git commit -m "Add another img" [master 88b381c] Add another img 1 file changed, 3 insertions(+) create mode 100644 random1.png ➜ lfs-file-locking git:(master) git push origin master Uploading LFS objects: 100% (1/1), 540 KB | 0 B/s, done. Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 12 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 1.03 KiB | 1.03 MiB/s, done. Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 To gitlab.com:gitlab-tests/lfs-file-locking.git f712c1e..88b381c master -> master
-
Check repo > files on the UI: the previously added img (
random.png
) shows the padlock:
Test project: https://gitlab.com/gitlab-tests/lfs-file-locking