From aede4d203cdb2a3d2d0cecb1d56320538e123a70 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 29 Oct 2025 22:16:10 +0800 Subject: [PATCH] fetchFromGitHub: pass rev uniformly --- pkgs/build-support/fetchgithub/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index ea40c6adbd55..4c3ea354fa68 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -110,8 +110,6 @@ lib.makeOverridable ( gitRepoUrl = "${baseUrl}.git"; - revWithTag = if tag != null then "refs/tags/${tag}" else rev; - fetcherArgs = finalAttrs: passthruAttrs @@ -137,6 +135,9 @@ lib.makeOverridable ( } // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; } else + let + revWithTag = finalAttrs.rev; + in { # Use the API endpoint for private repos, as the archive URI doesn't # support access with GitHub's fine-grained access tokens. @@ -161,6 +162,11 @@ lib.makeOverridable ( repo tag ; + rev = fetchgit.getRevWithTag { + inherit (finalAttrs) tag; + rev = finalAttrs.revCustom; + }; + revCustom = rev; }; passthru = { inherit gitRepoUrl; @@ -176,7 +182,4 @@ lib.makeOverridable ( in fetcher fetcherArgs - // { - rev = revWithTag; - } )