Skip to content

Commit 3d2f98d

Browse files
committed
(fix): disable sparse checkout cone mode to prevent root file leaks
1 parent c544e5a commit 3d2f98d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/VCS/Adapter/Git/GitHub.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,9 @@ public function generateCloneCommand(string $owner, string $repositoryName, stri
863863
"git config --global init.defaultBranch main",
864864
"git init",
865865
"git remote add origin {$cloneUrl}",
866-
// Enable sparse checkout
866+
// Enable non-cone sparse checkout (cone mode includes root-level files)
867867
"git config core.sparseCheckout true",
868+
"git config core.sparseCheckoutCone false",
868869
"echo {$rootDirectory} >> .git/info/sparse-checkout",
869870
// Disable fetching of refs we don't need
870871
"git config --add remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'",

0 commit comments

Comments
 (0)