diff options
author | Artturin <Artturin@artturin.com> | 2022-11-18 17:17:51 +0200 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2022-11-18 17:17:51 +0200 |
commit | 962929884a5b841521faf914497f847d5f07955f (patch) | |
tree | 89f107812cce01e18c0db4a6d0dfc1ec23247913 /lib | |
parent | dba0c71b6d15e323d4b8235d9474322520938dc8 (diff) | |
download | nixlib-962929884a5b841521faf914497f847d5f07955f.tar nixlib-962929884a5b841521faf914497f847d5f07955f.tar.gz nixlib-962929884a5b841521faf914497f847d5f07955f.tar.bz2 nixlib-962929884a5b841521faf914497f847d5f07955f.tar.lz nixlib-962929884a5b841521faf914497f847d5f07955f.tar.xz nixlib-962929884a5b841521faf914497f847d5f07955f.tar.zst nixlib-962929884a5b841521faf914497f847d5f07955f.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sources.nix | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sources.nix b/lib/sources.nix index 9db3d2329542..3ad7dc633554 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 <nixpkgs/.git> */ 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 <nixpkgs/.git> - */ - commitIdFromGitRepoOrError = + # Example: commitIdFromGitRepo <nixpkgs/.git> + # not exported, used for commitIdFromGitRepo + _commitIdFromGitRepoOrError = let readCommitFromFile = file: path: let fileName = path + "/${file}"; packedRefsName = path + "/packed-refs"; |