From 00dc3dcf8bfb3d7806fefa83e1e65d46cd6b5e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 26 Sep 2021 15:41:34 +0200 Subject: [PATCH] fetchFromGitHub: allow forcing fetchGit --- pkgs/build-support/fetchgithub/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index 91ffe4c6d8ed..ea95bbb47931 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;