Skip to contentSkip to conversation

git sparse-checkout set not working in git 2.27.0

DISCUSSION Alasdair Hurst 2 participants 2 messages Jun 11, 2020

lore
Share & tools
lore
#0 lore raw

In git 2.27.0 sparse-checkout doesn't seem to work the same as it did in 2.25.0:

Version: git version 2.27.0.windows.1 (the same behavior occurs on 2.27.0 on linux too)

Commands:
-git clone [email protected]:user/repo <mailto:[email protected]:user/repo> --no-checkout --depth 1 sparse-repo

-cd sparse-repo

-git sparse-checkout init

-git sparse-checkout add packages

Expected behavior (as seen in 0.25):

-ls
packages

The packages directory is checked out and available the repo root.

Current behavior

-ls

No packages directory is checked out and the root is empty.

#1 lore raw
Quoted 29 lines · Alasdair Hurst

In git 2.27.0 sparse-checkout doesn't seem to work the same as it did in 2.25.0:

Version: git version 2.27.0.windows.1 (the same behavior occurs on 2.27.0 on linux too)

Commands:

(quoted diff) +0 -5
-git clone [email protected]:user/repo <mailto:[email protected]:user/repo>
--no-checkout --depth 1 sparse-repo
 
-cd sparse-repo
 
-git sparse-checkout init
 
-git sparse-checkout add packages

Expected behavior (as seen in 0.25):

-ls
packages

The packages directory is checked out and available the repo root.

Quoted 7 lines

Current behavior

-ls

No packages directory is checked out and the root is empty.

Thanks for the report; this was fixed by commit b5bfc08a97 ("sparse-checkout: avoid staging deletions of all files", 2020-06-05), currently cooking in the 'next' branch of git.git. See the thread at
https://lore.kernel.org/git/[email protected]/
if you want to read up on it.