summary refs log tree commit diff
path: root/pkgs/build-support/fetchgithub
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-10-01 18:01:22 +0000
committerGitHub <noreply@github.com>2021-10-01 18:01:22 +0000
commit1256bc4623ad64c6c8ae9232cd5d342d697348c7 (patch)
tree2bf3183d3e57c5d25ace2281fc932606791a244a /pkgs/build-support/fetchgithub
parentc641792c36f83df6122172f85f0f662d86e15f60 (diff)
parent598ad679d8d6e5d00b1565191dc69780c2347be9 (diff)
downloadnixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.tar
nixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.tar.gz
nixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.tar.bz2
nixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.tar.lz
nixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.tar.xz
nixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.tar.zst
nixpkgs-1256bc4623ad64c6c8ae9232cd5d342d697348c7.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/build-support/fetchgithub')
-rw-r--r--pkgs/build-support/fetchgithub/default.nix10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix
index 3f355d10f8a..ea95bbb4793 100644
--- a/pkgs/build-support/fetchgithub/default.nix
+++ b/pkgs/build-support/fetchgithub/default.nix
@@ -2,7 +2,7 @@
 
 { owner, repo, rev, name ? "source"
 , fetchSubmodules ? false, leaveDotGit ? null
-, deepClone ? false, private ? false
+, deepClone ? false, private ? false, forceFetchGit ? false
 , githubBase ? "github.com", varPrefix ? null
 , ... # For hash agility
 }@args:
@@ -10,7 +10,7 @@ let
   baseUrl = "https://${githubBase}/${owner}/${repo}";
   passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "private" "githubBase" "varPrefix" ];
   varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
-  useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone;
+  useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit;
   # We prefer fetchzip in cases we don't need submodules as the hash
   # is more stable in that case.
   fetcher = if useFetchGit then fetchgit else fetchzip;
@@ -32,10 +32,8 @@ let
     then {
       inherit rev deepClone fetchSubmodules; url = "${baseUrl}.git";
     } // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
-    else ({ url = "${baseUrl}/archive/${rev}.tar.gz"; } // privateAttrs)
-  ) // passthruAttrs // { inherit name; };
+    else { url = "${baseUrl}/archive/${rev}.tar.gz"; }
+  ) // privateAttrs // passthruAttrs // { inherit name; };
 in
 
-assert private -> !useFetchGit;
-
 fetcher fetcherArgs // { meta.homepage = baseUrl; inherit rev; }