Rename UnionInputAccessor to MountedInputAccessor

This commit is contained in:
Eelco Dolstra 2023-11-14 14:01:38 +01:00
parent 21140c987b
commit 7f576f5dfe
4 changed files with 19 additions and 19 deletions

View file

@ -9,7 +9,7 @@
#include "processes.hh" #include "processes.hh"
#include "git.hh" #include "git.hh"
#include "fs-input-accessor.hh" #include "fs-input-accessor.hh"
#include "union-input-accessor.hh" #include "mounted-input-accessor.hh"
#include "git-utils.hh" #include "git-utils.hh"
#include "fetch-settings.hh" #include "fetch-settings.hh"
@ -587,7 +587,7 @@ struct GitInputScheme : InputScheme
auto accessor = repo->getAccessor(rev); auto accessor = repo->getAccessor(rev);
/* If the repo has submodules, fetch them and return a union /* If the repo has submodules, fetch them and return a mounted
input accessor consisting of the accessor for the top-level input accessor consisting of the accessor for the top-level
repo and the accessors for the submodules. */ repo and the accessors for the submodules. */
if (repoInfo.submodules) { if (repoInfo.submodules) {
@ -611,7 +611,7 @@ struct GitInputScheme : InputScheme
if (!mounts.empty()) { if (!mounts.empty()) {
mounts.insert_or_assign(CanonPath::root, accessor); mounts.insert_or_assign(CanonPath::root, accessor);
accessor = makeUnionInputAccessor(std::move(mounts)); accessor = makeMountedInputAccessor(std::move(mounts));
} }
} }
@ -636,7 +636,7 @@ struct GitInputScheme : InputScheme
ref<InputAccessor> accessor = ref<InputAccessor> accessor =
makeFSInputAccessor(CanonPath(repoInfo.url), repoInfo.workdirInfo.files, makeNotAllowedError(repoInfo.url)); makeFSInputAccessor(CanonPath(repoInfo.url), repoInfo.workdirInfo.files, makeNotAllowedError(repoInfo.url));
/* If the repo has submodules, return a union input accessor /* If the repo has submodules, return a mounted input accessor
consisting of the accessor for the top-level repo and the consisting of the accessor for the top-level repo and the
accessors for the submodule workdirs. */ accessors for the submodule workdirs. */
if (repoInfo.submodules && !repoInfo.workdirInfo.submodules.empty()) { if (repoInfo.submodules && !repoInfo.workdirInfo.submodules.empty()) {
@ -660,7 +660,7 @@ struct GitInputScheme : InputScheme
} }
mounts.insert_or_assign(CanonPath::root, accessor); mounts.insert_or_assign(CanonPath::root, accessor);
accessor = makeUnionInputAccessor(std::move(mounts)); accessor = makeMountedInputAccessor(std::move(mounts));
} }
if (!repoInfo.workdirInfo.isDirty) { if (!repoInfo.workdirInfo.isDirty) {

View file

@ -1,12 +1,12 @@
#include "union-input-accessor.hh" #include "mounted-input-accessor.hh"
namespace nix { namespace nix {
struct UnionInputAccessor : InputAccessor struct MountedInputAccessor : InputAccessor
{ {
std::map<CanonPath, ref<InputAccessor>> mounts; std::map<CanonPath, ref<InputAccessor>> mounts;
UnionInputAccessor(std::map<CanonPath, ref<InputAccessor>> _mounts) MountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> _mounts)
: mounts(std::move(_mounts)) : mounts(std::move(_mounts))
{ {
// Currently we require a root filesystem. This could be relaxed. // Currently we require a root filesystem. This could be relaxed.
@ -71,9 +71,9 @@ struct UnionInputAccessor : InputAccessor
} }
}; };
ref<InputAccessor> makeUnionInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts) ref<InputAccessor> makeMountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts)
{ {
return make_ref<UnionInputAccessor>(std::move(mounts)); return make_ref<MountedInputAccessor>(std::move(mounts));
} }
} }

View file

@ -0,0 +1,9 @@
#pragma once
#include "input-accessor.hh"
namespace nix {
ref<InputAccessor> makeMountedInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts);
}

View file

@ -1,9 +0,0 @@
#pragma once
#include "input-accessor.hh"
namespace nix {
ref<InputAccessor> makeUnionInputAccessor(std::map<CanonPath, ref<InputAccessor>> mounts);
}