-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
git lfs lock works incorrectly if the CD contains a junction, and the lock can't be removed #3554
Comments
Hey, thanks for writing in. This is an interesting problem that we haven't seen before. We're producing a relative path that is outside of the top-level directory, which we shouldn't be doing. We rely on Git to canonicalize the path that it gives us, but I'm thinking that in this case, that might not be happening. Can you provide the output of |
Here it is:
|
Thanks for that information. I've looked at this on a Windows VM and the issue is that Git LFS, on the other hand, resolves those paths correctly, and then there's a mismatch between the absolute directory computed by Git LFS and the unresolved path produced by Git. I've opened git-for-windows/git#2114 to get this issue addressed. I think on our side, we need to reject any relative paths that contain |
@bk2204 Thanks implementing a fix. Could you please send me a binary version including it? |
Sure. There are two binaries in the attached zip file, but note that they aren't signed. |
Thanks a lot!
Then the project maintainer kindly promoted me as project admin.
Notice the duplicated \Users\Larvoire in the error message above.
Success at last, despite the error message. :-) Jean-François |
Using Git for Windows v2.21.0.
In my root directory, I have a C:\JFL junction that points to my home directory C:\Users\Larvoire\Documents. To save typing, I usually use that junction to quickly change the current directory to one of my sources directories.
I ran the commands below, and now I can't get rid of the lock:
(Side issue (?): When I tried using the relative path above, notice how the FindFirstFile error references a pathname that's obviously wrong, with \Users\Larvoire\Documents\SRC repeated twice!
I tried moving up two levels, to the base of the project. There the symptom is the same, but the repeating string is \Users\Larvoire.
Unfortunately, I can't go two more levels up, because then git can't find its project configuration files.)
When not using the C:\JFL junction, another lock can be created and deleted, but the initial lock still can't:
I suspect this is another case of bug #3277 "Canonicalize paths properly on Windows".
While you're at it, you may want to check if SYMLINKD symbolic links have the same problem. (As junctions are just variations on that theme.)
Also the unlock --force option should be able to remove the lock when specified by ID, even if it thinks that the path does not make sense.
The text was updated successfully, but these errors were encountered: