···
{ url, rev ? "HEAD", md5 ? "", sha256 ? "", hash ? "", leaveDotGit ? deepClone
, fetchSubmodules ? true, deepClone ? false
18
-
, sparseCheckout ? ""
18
+
, sparseCheckout ? []
, name ? urlToName url rev
, # Shell code executed after the file has been fetched
···
assert deepClone -> leaveDotGit;
58
-
assert nonConeMode -> (sparseCheckout != "");
58
+
assert nonConeMode -> !(sparseCheckout == "" || sparseCheckout == []);
throw "fetchgit does not support md5 anymore, please use sha256"
else if hash != "" && sha256 != "" then
throw "Only one of sha256 or hash can be set"
66
+
lib.warnIf (builtins.isString sparseCheckout)
67
+
"Please provide directories/patterns for sparse checkout as a list of strings. Support for passing a (multi-line) string is deprecated and will be removed in the next release."
stdenvNoCC.mkDerivation {
···
82
-
inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName sparseCheckout nonConeMode postFetch;
85
+
# git-sparse-checkout(1) says:
86
+
# > When the --stdin option is provided, the directories or patterns are read
87
+
# > from standard in as a newline-delimited list instead of from the arguments.
88
+
sparseCheckout = if builtins.isString sparseCheckout then sparseCheckout else builtins.concatStringsSep "\n" sparseCheckout;
90
+
inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName nonConeMode postFetch;
postHook = if netrcPhase == null then null else ''