GitArchiveInputScheme: Require a NAR hash

This commit is contained in:
Eelco Dolstra 2024-02-21 12:08:18 +01:00
parent 071dd2b3a4
commit 09d76e512a

View File

@ -282,7 +282,11 @@ struct GitArchiveInputScheme : InputScheme
bool isLocked(const Input & input) const override
{
return (bool) input.getRev();
/* Since we can't verify the integrity of the tarball from the
Git revision alone, we also require a NAR hash for
locking. FIXME: in the future, we may want to require a Git
tree hash instead of a NAR hash. */
return input.getRev().has_value() && input.getNarHash().has_value();
}
std::optional<ExperimentalFeature> experimentalFeature() const override