-
Notifications
You must be signed in to change notification settings - Fork 2k
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
does not honor git -c url.<url>.insteadOf
when inside a submodule
#5665
Comments
On my laptop I was unable to reproduce the issue today, on Monday I'll try to test it at work again. On the gitlab ticket the analysis is ongoing |
Hey, thanks for the report, and I'm sorry you're having trouble. I don't have GitLab to test with, and so far I haven't been able to reproduce something similar to this issue (while fetching from GitHub), so I'll be interested in what you find from your ongoing investigation. Here's what I've tried so far, which seems to work OK, meaning that
Then I clone the repos, including the submodule repo, but without fetching any Git LFS objects, and with a Git config rule to rewrite the broken URL to the correct one:
Finally, I fetch the Git LFS objects within the submodule repo, and the URL rewriting seems to work as expected:
Whereas, if I leave out the URL rewriting rule, the request to the Git LFS Batch API endpoint receives a 403, since the URL is incorrect. One difference between my test setup and yours is that you are trying to inject authorization credentials into the rewritten URL. It would be interesting if you are able to reproduce the problem when trying to do that, but not when trying to rewrite the URL in some other way, as in my example above. At any rate, keep us posted with anything you find out! |
Describe the bug
When trying to fetch objects tracked by lfs inside a submodule,
url.<url>.insteadOf
is apparently not used and fetch fails.If the submodule is fetched directly then
git -c url.<url>.insteadOf lfs fetch -a
worksI noticed this issue during CI execution where
git -c url.<url>.insteadOf
is used to pass authentication token to git server. Here the original issue I submittedNote: No issue arise during submodule clone because the submodule at the current version does not contain LFS objects
Issues arise when performing both
git lfs fetch -a
andgit submodule checkout <version-with-lfs-files>
To Reproduce
Steps to reproduce the behavior:
git -c url.http://valo:password@gitlab.lan.insteadOf=http://gitlab.lan clone --recurse-submodules http://gitlab.lan/group/myproject.git
git -c url.http://valo:password@gitlab.lan.insteadOf=http://gitlab.lan lfs fetch -a
If the same steps are performed directly cloning the repository used as submodule everything works
Expected behavior
LFS-tracked files are correctly retrieved
System environment
The version of your operating system, plus any relevant information about platform or configuration (e.g., container or CI usage, Cygwin, WSL, or non-Basic authentication). If relevant, include the output of
git config -l
as a code block.I tried with both
lfs.transfer.enablehrefrewrite=true
andlfs.transfer.enablehrefrewrite=false
but I'm getting the same resultOutput of
git lfs env
git lfs env without git -c
git lfs env using -c
Additional context
Any other relevant context about the problem here.
Successfull run when cloning the project directly
Unsuccessfull run when using submodule
Very verbose output obtained using
GIT_TRACE_PACK_ACCESS=1 GIT_TRANSFER_TRACE=1 GIT_TRACE_SETUP=1 GIT_TRACE=1
when not using the submodule
Very verbose output obtained using
GIT_TRACE_PACK_ACCESS=1 GIT_TRANSFER_TRACE=1 GIT_TRACE_SETUP=1 GIT_TRACE=1
when using the submodule and failing
The text was updated successfully, but these errors were encountered: