-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
LFS locks not enforced on server side (can push commit modifying a file locked by another user) #11094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I met this problem too, please consider this request. |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
Just ran into this issue. |
I am also experiencing this issue with Gitea version 1.13.2 and Git LFS version 2.13.2. Is there any plan to fix Gitea to enforce LFS locking? |
Having the same problem with Gitea 1.15.0. Would be nice to see this in a future release! |
Maybe we need check the lock in the function https://github.com/go-gitea/gitea/blob/v1.15.0/services/lfs/server.go#L253 |
Bump. What is the point of having locks if they are not enforced? Or am I missing something? |
I do need this feature as well. |
I do need this feature as well. Gitea version 1.18.5 and Git LFS version 3.3.0. |
[x]
):Description
Steps to reproduce:
lfs_admin
and passwordLFS_admin1
and extract the attached scripts.zip to a convenient directory.GITEAHOST
in line 3 ofs01_admin.sh
(in attached zip) to match your gitea host name and save../s01_admin.sh
in a git bash.
This creates two users (
a_user
,b_user
) and givesa_user
a repoa_lfs_test
, to whichb_user
is added as collaborator withwrite
permissionGITEAHOST
in line 4 ofs02_a_user.sh
(in attached zip) to match your gitea host and save../s02_a_user.sh
in a git bash.
This initializes the
a_lfs_test
repo in sub-foldera_repo
and puts all *.png files as lockable under LFS control. A fileimg.png
is created and initialized with the content ofwiki.png
. This file and.gitattributes
are staged, commited and pushed. Afterwards, theimg.png
file is locked bya_user
.GITEAHOST
in line 4 ofs03_b_user.sh
(in attached zip) to match your gitea host and save../s03_b_user.sh
in a git bash (perhaps on a different machine, the result is the same).
This clones the
a_lfs_test
repo into subfolderb_repo
and initializes LFS. Because.gitattributes
is checked out, LFS and locks are enabled for.png
files.img.png
is force overwritten by the contents ofdice.png
, staged, committed and pushed../s03_b_user.sh
in the previous step:Unable to push locked files:(1/1)
is returned, only a warningWARNING: The above files would have halted this push.
results and the push succeeds2e229ad..d78418b master -> master
even though the lock ofa_user
persists (git lfs locks
->img.png A_User ID:2
)img.png
in the gitea UI: It shows the lock ofa_user
, but the content ofdice.png
pushed byb_user
.Expected result:
The push by
b_user
should be rejected (at least through a gitea configuration option), becausea_user
still holds a lock onimg.png
Actual Result:
The push succeeds and the locked file
img.png
is modified byb_user
Requested change:
Please add a gitea configuration setting (either global or even better per repo) to reject such pushes on the server side, since otherwise locks are meaningless if the default client configuration is used. This leaves locks totally up to correct client configuration, which is error prone and negates the "protection" that locks should offer.
Thanks for gitea and for considering this request.
scripts.zip
The text was updated successfully, but these errors were encountered: