···5454*/
55555656assert deepClone -> leaveDotGit;
5757-assert nonConeMode -> !(sparseCheckout == "" || sparseCheckout == []);
5757+assert nonConeMode -> (sparseCheckout != []);
58585959if md5 != "" then
6060 throw "fetchgit does not support md5 anymore, please use sha256"
6161else if hash != "" && sha256 != "" then
6262 throw "Only one of sha256 or hash can be set"
6363+else if builtins.isString sparseCheckout then
6464+ # Changed to throw on 2023-06-04
6565+ throw "Please provide directories/patterns for sparse checkout as a list of strings. Passing a (multi-line) string is not supported any more."
6366else
6464-# Added 2022-11-12
6565-lib.warnIf (builtins.isString sparseCheckout)
6666- "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."
6767stdenvNoCC.mkDerivation {
6868 inherit name;
6969 builder = ./builder.sh;
···8484 # git-sparse-checkout(1) says:
8585 # > When the --stdin option is provided, the directories or patterns are read
8686 # > from standard in as a newline-delimited list instead of from the arguments.
8787- sparseCheckout = if builtins.isString sparseCheckout then sparseCheckout else builtins.concatStringsSep "\n" sparseCheckout;
8787+ sparseCheckout = builtins.concatStringsSep "\n" sparseCheckout;
88888989 inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName nonConeMode postFetch;
9090
+1-1
pkgs/build-support/fetchgithub/default.nix
···2525 };
2626 passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "forceFetchGit" "private" "githubBase" "varPrefix" ];
2727 varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
2828- useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || !(sparseCheckout == "" || sparseCheckout == []);
2828+ useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != []);
2929 # We prefer fetchzip in cases we don't need submodules as the hash
3030 # is more stable in that case.
3131 fetcher = if useFetchGit then fetchgit else fetchzip;