mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
fetchgitlab: add option to force fetchgit
This commit is contained in:
parent
a838881cda
commit
cf00f9c2ea
@ -4,7 +4,7 @@ lib.makeOverridable (
|
||||
# gitlab example
|
||||
{ owner, repo, rev, protocol ? "https", domain ? "gitlab.com", name ? "source", group ? null
|
||||
, fetchSubmodules ? false, leaveDotGit ? false
|
||||
, deepClone ? false
|
||||
, deepClone ? false, forceFetchGit ? false
|
||||
, sparseCheckout ? []
|
||||
, ... # For hash agility
|
||||
} @ args:
|
||||
@ -13,9 +13,9 @@ let
|
||||
slug = lib.concatStringsSep "/" ((lib.optional (group != null) group) ++ [ owner repo ]);
|
||||
escapedSlug = lib.replaceStrings [ "." "/" ] [ "%2E" "%2F" ] slug;
|
||||
escapedRev = lib.replaceStrings [ "+" "%" "/" ] [ "%2B" "%25" "%2F" ] rev;
|
||||
passthruAttrs = removeAttrs args [ "protocol" "domain" "owner" "group" "repo" "rev" "fetchSubmodules" "leaveDotGit" "deepClone" ];
|
||||
passthruAttrs = removeAttrs args [ "protocol" "domain" "owner" "group" "repo" "rev" "fetchSubmodules" "forceFetchGit" "leaveDotGit" "deepClone" ];
|
||||
|
||||
useFetchGit = fetchSubmodules || leaveDotGit || deepClone || (sparseCheckout != []);
|
||||
useFetchGit = fetchSubmodules || leaveDotGit || deepClone || forceFetchGit || (sparseCheckout != []);
|
||||
fetcher = if useFetchGit then fetchgit else fetchzip;
|
||||
|
||||
gitRepoUrl = "${protocol}://${domain}/${slug}.git";
|
||||
|
Loading…
Reference in New Issue
Block a user