forked from mirrors/nixpkgs
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.
This commit is contained in:
parent
dba0c71b6d
commit
962929884a
|
@ -166,7 +166,7 @@ let
|
||||||
in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
|
in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
|
||||||
in cleanSourceWith { inherit filter src; };
|
in cleanSourceWith { inherit filter src; };
|
||||||
|
|
||||||
pathIsGitRepo = path: (commitIdFromGitRepoOrError path)?value;
|
pathIsGitRepo = path: (_commitIdFromGitRepoOrError path)?value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Get the commit id of a git repo.
|
Get the commit id of a git repo.
|
||||||
|
@ -174,17 +174,16 @@ let
|
||||||
Example: commitIdFromGitRepo <nixpkgs/.git>
|
Example: commitIdFromGitRepo <nixpkgs/.git>
|
||||||
*/
|
*/
|
||||||
commitIdFromGitRepo = path:
|
commitIdFromGitRepo = path:
|
||||||
let commitIdOrError = commitIdFromGitRepoOrError path;
|
let commitIdOrError = _commitIdFromGitRepoOrError path;
|
||||||
in commitIdOrError.value or (throw commitIdOrError.error);
|
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>
|
# Example: commitIdFromGitRepo <nixpkgs/.git>
|
||||||
*/
|
# not exported, used for commitIdFromGitRepo
|
||||||
commitIdFromGitRepoOrError =
|
_commitIdFromGitRepoOrError =
|
||||||
let readCommitFromFile = file: path:
|
let readCommitFromFile = file: path:
|
||||||
let fileName = path + "/${file}";
|
let fileName = path + "/${file}";
|
||||||
packedRefsName = path + "/packed-refs";
|
packedRefsName = path + "/packed-refs";
|
||||||
|
|
Loading…
Reference in a new issue