mirror of
https://github.com/NixOS/nix.git
synced 2025-11-30 06:01:00 +01:00
GitArchiveInputScheme: Bring back the narHash attribute
This is needed to verify that the source tree served by GitHub hasn't changed compared to the lock file. Computing the narHash for a nixpkgs source tree only takes ~0.6s and it's cached. So the cost is fairly negligible compared to the download time.
This commit is contained in:
parent
8342317d4d
commit
4072024d79
3 changed files with 35 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "archive.hh"
|
||||
#include "canon-path.hh"
|
||||
#include "repair-flag.hh"
|
||||
#include "hash.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
@ -57,6 +58,11 @@ struct InputAccessor : public std::enable_shared_from_this<InputAccessor>
|
|||
Sink & sink,
|
||||
PathFilter & filter = defaultPathFilter);
|
||||
|
||||
Hash hashPath(
|
||||
const CanonPath & path,
|
||||
PathFilter & filter = defaultPathFilter,
|
||||
HashType ht = htSHA256);
|
||||
|
||||
StorePath fetchToStore(
|
||||
ref<Store> store,
|
||||
const CanonPath & path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue