Skip to content

Commit

Permalink
GitArchiveInputScheme: Require a NAR hash
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Feb 21, 2024
1 parent 071dd2b commit 09d76e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libfetchers/github.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09d76e5

Please sign in to comment.