From 962929884a5b841521faf914497f847d5f07955f Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 18 Nov 2022 17:17:51 +0200 Subject: lib/sources: make commitIdFromGitRepoOrError internal and use # for comments so that it doesn't make the manual build fail > Apparently this is related to the combination of this new function not getting exported from the file, while still getting documented. --- lib/sources.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/sources.nix') diff --git a/lib/sources.nix b/lib/sources.nix index 9db3d23295421..3ad7dc6335549 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -166,7 +166,7 @@ let in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts; in cleanSourceWith { inherit filter src; }; - pathIsGitRepo = path: (commitIdFromGitRepoOrError path)?value; + pathIsGitRepo = path: (_commitIdFromGitRepoOrError path)?value; /* Get the commit id of a git repo. @@ -174,17 +174,16 @@ let Example: commitIdFromGitRepo */ commitIdFromGitRepo = path: - let commitIdOrError = commitIdFromGitRepoOrError path; + let commitIdOrError = _commitIdFromGitRepoOrError path; in commitIdOrError.value or (throw commitIdOrError.error); - /* - Get the commit id of a git repo. + # Get the commit id of a git repo. - Returns `{ value = commitHash }` or `{ error = "... message ..." }`. + # Returns `{ value = commitHash }` or `{ error = "... message ..." }`. - Example: commitIdFromGitRepo - */ - commitIdFromGitRepoOrError = + # Example: commitIdFromGitRepo + # not exported, used for commitIdFromGitRepo + _commitIdFromGitRepoOrError = let readCommitFromFile = file: path: let fileName = path + "/${file}"; packedRefsName = path + "/packed-refs"; -- cgit 1.4.1