···54*/
5556assert deepClone -> leaveDotGit;
57-assert nonConeMode -> !(sparseCheckout == "" || sparseCheckout == []);
5859if md5 != "" then
60 throw "fetchgit does not support md5 anymore, please use sha256"
61else if hash != "" && sha256 != "" then
62 throw "Only one of sha256 or hash can be set"
00063else
64-# Added 2022-11-12
65-lib.warnIf (builtins.isString sparseCheckout)
66- "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."
67stdenvNoCC.mkDerivation {
68 inherit name;
69 builder = ./builder.sh;
···84 # git-sparse-checkout(1) says:
85 # > When the --stdin option is provided, the directories or patterns are read
86 # > from standard in as a newline-delimited list instead of from the arguments.
87- sparseCheckout = if builtins.isString sparseCheckout then sparseCheckout else builtins.concatStringsSep "\n" sparseCheckout;
8889 inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName nonConeMode postFetch;
90
···54*/
5556assert deepClone -> leaveDotGit;
57+assert nonConeMode -> (sparseCheckout != []);
5859if md5 != "" then
60 throw "fetchgit does not support md5 anymore, please use sha256"
61else if hash != "" && sha256 != "" then
62 throw "Only one of sha256 or hash can be set"
63+else if builtins.isString sparseCheckout then
64+ # Changed to throw on 2023-06-04
65+ throw "Please provide directories/patterns for sparse checkout as a list of strings. Passing a (multi-line) string is not supported any more."
66else
00067stdenvNoCC.mkDerivation {
68 inherit name;
69 builder = ./builder.sh;
···84 # git-sparse-checkout(1) says:
85 # > When the --stdin option is provided, the directories or patterns are read
86 # > from standard in as a newline-delimited list instead of from the arguments.
87+ sparseCheckout = builtins.concatStringsSep "\n" sparseCheckout;
8889 inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName nonConeMode postFetch;
90
+1-1
pkgs/build-support/fetchgithub/default.nix
···25 };
26 passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "forceFetchGit" "private" "githubBase" "varPrefix" ];
27 varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
28- useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || !(sparseCheckout == "" || sparseCheckout == []);
29 # We prefer fetchzip in cases we don't need submodules as the hash
30 # is more stable in that case.
31 fetcher = if useFetchGit then fetchgit else fetchzip;
···25 };
26 passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "forceFetchGit" "private" "githubBase" "varPrefix" ];
27 varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
28+ useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != []);
29 # We prefer fetchzip in cases we don't need submodules as the hash
30 # is more stable in that case.
31 fetcher = if useFetchGit then fetchgit else fetchzip;