1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Cleanup ContentAddressMethod to match docs

The old `std::variant` is bad because we aren't adding a new case to
`FileIngestionMethod` so much as we are defining a separate concept ---
store object content addressing rather than file system object content
addressing. As such, it is more correct to just create a fresh
enumeration.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
John Ericson 2024-05-16 19:08:28 -04:00
parent 64e599ebe1
commit b51e161af5
25 changed files with 275 additions and 203 deletions

View file

@ -55,15 +55,15 @@ VERSIONED_CHARACTERIZATION_TEST(
defaultVersion,
(std::tuple<ContentAddress, ContentAddress, ContentAddress> {
ContentAddress {
.method = TextIngestionMethod {},
.method = ContentAddressMethod::Raw::Text,
.hash = hashString(HashAlgorithm::SHA256, "Derive(...)"),
},
ContentAddress {
.method = FileIngestionMethod::Flat,
.method = ContentAddressMethod::Raw::Flat,
.hash = hashString(HashAlgorithm::SHA1, "blob blob..."),
},
ContentAddress {
.method = FileIngestionMethod::NixArchive,
.method = ContentAddressMethod::Raw::NixArchive,
.hash = hashString(HashAlgorithm::SHA256, "(...)"),
},
}))
@ -398,7 +398,7 @@ VERSIONED_CHARACTERIZATION_TEST(
std::nullopt,
std::optional {
ContentAddress {
.method = FileIngestionMethod::Flat,
.method = ContentAddressMethod::Raw::Flat,
.hash = hashString(HashAlgorithm::SHA1, "blob blob..."),
},
},