mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 13:06:01 +01:00
Issue #15 is finished
This commit is contained in:
parent
e007f367bd
commit
5e4d92d267
6 changed files with 136 additions and 15 deletions
|
|
@ -152,4 +152,19 @@ bool FlakeRef::isImmutable() const
|
|||
else abort();
|
||||
}
|
||||
|
||||
FlakeRef FlakeRef::baseRef() const // Removes the ref and rev from a FlakeRef.
|
||||
{
|
||||
FlakeRef result(*this);
|
||||
if (auto refData = std::get_if<FlakeRef::IsGitHub>(&result.data)) {
|
||||
refData->ref = std::nullopt;
|
||||
refData->rev = std::nullopt;
|
||||
} else if (auto refData = std::get_if<FlakeRef::IsGit>(&result.data)) {
|
||||
refData->ref = std::nullopt;
|
||||
refData->rev = std::nullopt;
|
||||
} else if (auto refData = std::get_if<FlakeRef::IsGit>(&result.data)) {
|
||||
refData->ref = std::nullopt;
|
||||
refData->rev = std::nullopt;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue