feat(link): implement hard_link_hash_sync too

This commit is contained in:
Kat Marchán 2023-03-09 18:23:50 -08:00
parent 02d7f146f1
commit b88217cc54
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 10 additions and 0 deletions

View File

@ -627,6 +627,16 @@ where
inner(cache.as_ref(), key.as_ref(), to.as_ref())
}
/// Hard links a cache entry by integrity address to a specified location,
/// verifying contents as hard links are created.
pub fn hard_link_hash_sync<P, Q>(cache: P, sri: &Integrity, to: Q) -> Result<()>
where
P: AsRef<Path>,
Q: AsRef<Path>,
{
read::hard_link(cache.as_ref(), sri, to.as_ref())
}
/// Hard links a cache entry by integrity address to a specified location. The
/// cache entry contents will not be checked, and all the usual caveats of
/// hard links apply: The potentially-shared cache might be corrupted if the