fetchgit: default sparseCheckout to null and handle the default internally

This commit is contained in:
Yueh-Shun Li
2025-12-04 15:25:39 +08:00
parent 83b42e34ec
commit dd264228ff
+3 -2
View File
@@ -73,7 +73,8 @@ lib.makeOverridable (
fetchSubmodules ? true,
deepClone ? false,
branchName ? null,
sparseCheckout ? lib.optional (rootDir != "") rootDir,
# When null, will default to: `lib.optional (rootdir != "") rootdir`
sparseCheckout ? null,
# When null, will default to: `rootDir != ""`
nonConeMode ? null,
nativeBuildInputs ? [ ],
@@ -152,7 +153,7 @@ lib.makeOverridable (
inherit outputHash outputHashAlgo;
outputHashMode = "recursive";
inherit sparseCheckout;
sparseCheckout = lib.defaultTo (lib.optional (rootDir != "") rootDir) sparseCheckout;
sparseCheckoutText =
assert finalAttrs.nonConeMode -> (finalAttrs.sparseCheckout != [ ]);
# git-sparse-checkout(1) says: