1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

libfetchers/git: Move workdir accessor into GitRepo::getAccessor

This commit is contained in:
Robert Hensing 2023-12-11 22:28:53 +01:00
parent 8024b954d7
commit 7774eff10e
3 changed files with 26 additions and 4 deletions

View file

@ -9,7 +9,6 @@
#include "processes.hh"
#include "git.hh"
#include "fs-input-accessor.hh"
#include "filtering-input-accessor.hh"
#include "mounted-input-accessor.hh"
#include "git-utils.hh"
#include "logging.hh"
@ -659,10 +658,11 @@ struct GitInputScheme : InputScheme
for (auto & submodule : repoInfo.workdirInfo.submodules)
repoInfo.workdirInfo.files.insert(submodule.path);
auto repo = GitRepo::openRepo(CanonPath(repoInfo.url), false, false);
ref<InputAccessor> accessor =
AllowListInputAccessor::create(
makeFSInputAccessor(CanonPath(repoInfo.url)),
std::move(repoInfo.workdirInfo.files),
repo->getAccessor(repoInfo.workdirInfo,
getExportIgnoreAttr(input),
makeNotAllowedError(repoInfo.url));
/* If the repo has submodules, return a mounted input accessor