Skip to content

Commit

Permalink
Allow narHash or treeHash in Git archive inputs
Browse files Browse the repository at this point in the history
Without this, `nix build` fails because the lockfile doesn't include a
`treeHash` for the Git archive inputs (e.g. GitHub), but as I understand
it the `narHash` should be equivalent if it exists.
  • Loading branch information
9999years committed Mar 1, 2024
1 parent d2292a1 commit 527ea53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libfetchers/github.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ struct GitArchiveInputScheme : InputScheme
bool isLocked(const Input & input) const override
{
/* Since we can't verify the integrity of the tarball from the
Git revision alone, we also require a Git tree hash for
Git revision alone, we also require a Git tree hash or NAR hash for
locking. */
return input.getRev().has_value() && getTreeHash(input).has_value();
return input.getRev().has_value() && (getTreeHash(input).has_value() || input.getNarHash().has_value());
}

std::optional<ExperimentalFeature> experimentalFeature() const override
Expand Down

0 comments on commit 527ea53

Please sign in to comment.