Sparse worktree always contains root files
- From
- Jeppe Øland <joland@gmail.com>
- Date
- Mar 13, 2024, 18:16 UTC
- Message-ID
- <CA+osTZWsGv01xinFPKbTQOF9mpvfwWs4wJczHSZXLdRxf1OmwA@mail.gmail.com>
Hi there,
I'm trying to use sparse checkouts in a large project, and one oddity (bug?) came up.
If I do a normal full clone of a repository, then do:
git worktree add ../sparse --no-checkout
cd ../sparse
git sparse-checkout set somepath
git checkout
Now indeed it is a sparse worktree, but the files from the root
directory are also there.This also happens with traditional (non-worktree) partial clones. (I did both shallow, blob-less and tree-less, and all of them behave the same way)
Regards, -Jeppe