mirror of
https://github.com/NixOS/nix
synced 2025-06-26 15:51:15 +02:00
Git fetcher: Improve submodule handling
Instead of making a complete copy of the repo, fetching the submodules, and writing the result to the store (which is all superexpensive), we now fetch the submodules recursively using the Git fetcher, and return a union accessor that "mounts" the accessors for the submodules on top of the root accessor.
This commit is contained in:
parent
ee36a44bf2
commit
d88106df24
6 changed files with 212 additions and 84 deletions
|
@ -38,6 +38,18 @@ struct GitRepo
|
|||
/* Get the ref that HEAD points to. */
|
||||
virtual std::optional<std::string> getWorkdirRef() = 0;
|
||||
|
||||
struct Submodule
|
||||
{
|
||||
CanonPath path;
|
||||
std::string url;
|
||||
std::string branch;
|
||||
Hash rev;
|
||||
};
|
||||
|
||||
virtual std::vector<Submodule> getSubmodules(const Hash & rev) = 0;
|
||||
|
||||
virtual std::string resolveSubmoduleUrl(const std::string & url) = 0;
|
||||
|
||||
struct TarballInfo
|
||||
{
|
||||
Hash treeHash;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue