From 0fa3d10d7d6f5ce0813ff6e2358150f5c8657378 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 28 Aug 2021 10:29:10 +0200 Subject: [PATCH] fetchgit.tests: init --- pkgs/build-support/fetchgit/tests.nix | 10 ++++++++++ pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 pkgs/build-support/fetchgit/tests.nix diff --git a/pkgs/build-support/fetchgit/tests.nix b/pkgs/build-support/fetchgit/tests.nix new file mode 100644 index 000000000000..6805473e2968 --- /dev/null +++ b/pkgs/build-support/fetchgit/tests.nix @@ -0,0 +1,10 @@ +{ invalidateFetcherByDrvHash, fetchgit, ... }: + +{ + simple = invalidateFetcherByDrvHash fetchgit { + name = "nix-source"; + url = "https://github.com/NixOS/nix"; + rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a"; + sha256 = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY="; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b70b14f9ebb..deee409c6faf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -441,10 +441,12 @@ with pkgs; fetchfossil = callPackage ../build-support/fetchfossil { }; - fetchgit = callPackage ../build-support/fetchgit { + fetchgit = (callPackage ../build-support/fetchgit { git = buildPackages.gitMinimal; cacert = buildPackages.cacert; git-lfs = buildPackages.git-lfs; + }) // { # fetchgit is a function, so we use // instead of passthru. + tests = callPackages ../build-support/fetchgit/tests.nix {}; }; fetchgitLocal = callPackage ../build-support/fetchgitlocal { };