-
-
Notifications
You must be signed in to change notification settings - Fork 297
Description
Describe the bug
The sparse_paths flag uses echo "$sparse_paths" >> ./.git/info/sparse-checkout instead of using the expected git sparse-checkout set "${sparse_paths[@]}" command.
This behaves like git sparse-checkout set --no-cone [patterns] and you need to add special patterns /*,!/*/ to get the expected 'cone' behavior :(
https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set
Reproduction steps
Probably just needs to be updated in the documentation... specify that it behaves like --no-cone mode and add some examples of how to checkout the top level files without checking out all subdirs
Create a repo that has some subdirectories, and some files at the root..
try to set sparse_paths: ["subdir]" and it will not checkout anything at the root level because you need to add the extra patterns: sparse_paths: ["/*", "!/*/", "/subdir/"]
Expected behavior
Documentation should mention that it behaves like --no-cone mode, or there should be a sparse_cone flag that can be set...
Additional context
https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set