mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
fetchFromGitHub: use fetchgit when the rootDir option is set
This argument was added to fetchgit in #427165, and it's not supported by fetchzip. Co-authored-by: Philip Taron <philip.taron@gmail.com>
This commit is contained in:
@@ -860,7 +860,14 @@ A number of fetcher functions wrap part of `fetchurl` and `fetchzip`. They are m
|
||||
|
||||
To use a different GitHub instance, use `githubBase` (defaults to `"github.com"`).
|
||||
|
||||
`fetchFromGitHub` uses `fetchzip` to download the source archive generated by GitHub for the specified revision. If `leaveDotGit`, `deepClone` or `fetchSubmodules` are set to `true`, `fetchFromGitHub` will use `fetchgit` instead. Refer to its section for documentation of these options.
|
||||
By default, `fetchFromGitHub` uses `fetchzip` to download GitHub's source archive for the specified revision.
|
||||
However, `fetchFromGitHub` will automatically switch to using `fetchgit` in any of these cases:
|
||||
|
||||
- `forceFetchGit`, `leaveDotGit`, `deepClone`, `fetchLFS`, or `fetchSubmodules` are set to `true`
|
||||
- `sparseCheckout` contains any entries (is a non-empty list)
|
||||
- `rootDir` is set to a non-empty string
|
||||
|
||||
When `fetchgit` is used, refer to the `fetchgit` section for documentation of its available options.
|
||||
|
||||
## `fetchFromGitLab` {#fetchfromgitlab}
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ lib.makeOverridable (
|
||||
private ? false,
|
||||
forceFetchGit ? false,
|
||||
fetchLFS ? false,
|
||||
sparseCheckout ? [ ],
|
||||
rootDir ? "",
|
||||
sparseCheckout ? lib.optional (rootDir != "") rootDir,
|
||||
githubBase ? "github.com",
|
||||
varPrefix ? null,
|
||||
meta ? { },
|
||||
@@ -69,6 +70,7 @@ lib.makeOverridable (
|
||||
|| deepClone
|
||||
|| forceFetchGit
|
||||
|| fetchLFS
|
||||
|| (rootDir != "")
|
||||
|| (sparseCheckout != [ ]);
|
||||
# We prefer fetchzip in cases we don't need submodules as the hash
|
||||
# is more stable in that case.
|
||||
|
||||
Reference in New Issue
Block a user