LFS force unlock not working
Description
In projects in which LFS is configured and lockable files are configured, "Force unlock" does not work on files locked by another user.
The essence of the problem is that the "--force" flag for the "lfs unlock" command is not transmitted. If you repeat the command in git bash, with the necessary "force" flag, the file will be successfully unlocked. In tortoiseGit, today this problem is relevant even on the most recent assembly. There is no error message as such (it is identical to the message when trying to unlock a file without the "force" flag).
What steps will reproduce the problem?
- Set up a test repository, configure LFS to track files, as well as add the ability to block for any type of files, for example:
git lfs track "*.umap" --lockable
- Ask another user who has access to this repository to lock some locked file, for example:
git lfs lock "Content/DownToEarth/Maps/MainMenu.umap"
- In your local copy of the repository, call the context menu with the right mouse button and select the menu item
TortoiseGit -> LFS -> Show locked files
- In the window that opens, leave a check mark in front of the file locked by another user and click on "Unlock" button, as an example in screenshot
01.png
- Wait for the command to complete. The command will be executed with an error text that the file is locked by another user (this is the correct behavior).
- Now the "Force unlock" button will become available. You need to click on this button to repeat the execution of the command with the "--force" flag. The screenshot shows a debug message (if it is enabled in the settings), so that it can be seen that the "/force" parameter for TortoiseGit is successfully transmitted.
- Wait for the command to complete. As a result, we will see a similar error message that the file cannot be unlocked. it is blocked by another user. This is not the correct behavior, as the "/force" parameter for TortoiseGit should have added the "--force" parameter for the Git for Windows.
- To make sure that this is a bug and that something really does not work as it should (that there is a bug), you can repeat the step 6.
What is the expected output? What do you see instead?
Expected Result: At step 7, the completion of the command after clicking on "force unlock" should be successful and unlock the file that was locked by another user. Likewise, if we tried to unlock a file that was locked by me. As in the screenshot:
###What version of TortoiseGit and Git are you using? On what operating system?###
git --version
git version 2.31.1.windows.1
git lfs --version
git-lfs/2.13.3 (GitHub; windows amd64; go 1.16.2; git a5e65851)
TortoiseGit 2.12.0.0 (C:\Program Files\TortoiseGit\bin)
git version 2.31.1.windows.1 (C:\Program Files\Git\bin; C:\Program Files\Git\mingw64\; C:\Program Files\Git\etc\gitconfig)
windows 10 corporate
version 1909
Build the OS 18363.1533