Skip to content
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

Submodules don't run LFS checkout #113

Open
thechubbypanda opened this issue Dec 21, 2023 · 0 comments
Open

Submodules don't run LFS checkout #113

thechubbypanda opened this issue Dec 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@thechubbypanda
Copy link

thechubbypanda commented Dec 21, 2023

Say I have repo A and repo B. Repo A includes repo B as a submodule. Repo B has an lfs-stored png.

Using the default clone behaviour, the LFS PNG in repo B is not checked out when running a workflow on repo A.

+ git init -b main
Initialized empty Git repository in /woodpecker/src/git.example.com/keval/a/.git/
+ git config --global --replace-all safe.directory /woodpecker/src/git.example.com/keval/a
+ git remote add origin https://git.example.com/keval/a.git
+ git fetch --no-tags --depth=1 --filter=tree:0 origin +49d20190e4d712d6bd0ed36a771fde165feaee67:
From https://git.example.com/keval/a
 * branch            49d20190e4d712d6bd0ed36a771fde165feaee67 -> FETCH_HEAD
+ git reset --hard -q 49d20190e4d712d6bd0ed36a771fde165feaee67
+ git submodule update --init --recursive --depth=1 --recommend-shallow
Submodule 'assets/b' (https://git.example.com/keval/b.git) registered for path 'assets/b'
Cloning into '/woodpecker/src/git.example.com/keval/a/assets/b'...
Submodule path 'assets/b': checked out '27ca3abfff9c496fe3c8e969f32a057814c14e88'
+ git lfs fetch
fetch: Fetching reference refs/heads/main
+ git lfs checkout

assets/b/lfs.png is still an LFS text file

The following 2 commands fix the problem:

git submodule foreach git lfs pull
git submodule foreach git lfs checkout

But this could probably be tuned

@lafriks lafriks added the bug Something isn't working label Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants