diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 12233ed0a..90c6ad531 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -9,7 +9,7 @@ #include "processes.hh" #include "git.hh" #include "fs-input-accessor.hh" -#include "union-input-accessor.hh" +#include "mounted-input-accessor.hh" #include "git-utils.hh" #include "fetch-settings.hh" @@ -587,7 +587,7 @@ struct GitInputScheme : InputScheme 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 repo and the accessors for the submodules. */ if (repoInfo.submodules) { @@ -611,7 +611,7 @@ struct GitInputScheme : InputScheme if (!mounts.empty()) { 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 accessor = 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 accessors for the submodule workdirs. */ if (repoInfo.submodules && !repoInfo.workdirInfo.submodules.empty()) { @@ -660,7 +660,7 @@ struct GitInputScheme : InputScheme } mounts.insert_or_assign(CanonPath::root, accessor); - accessor = makeUnionInputAccessor(std::move(mounts)); + accessor = makeMountedInputAccessor(std::move(mounts)); } if (!repoInfo.workdirInfo.isDirty) { diff --git a/src/libfetchers/union-input-accessor.cc b/src/libfetchers/mounted-input-accessor.cc similarity index 86% rename from src/libfetchers/union-input-accessor.cc rename to src/libfetchers/mounted-input-accessor.cc index f9472efa7..49917f6e5 100644 --- a/src/libfetchers/union-input-accessor.cc +++ b/src/libfetchers/mounted-input-accessor.cc @@ -1,12 +1,12 @@ -#include "union-input-accessor.hh" +#include "mounted-input-accessor.hh" namespace nix { -struct UnionInputAccessor : InputAccessor +struct MountedInputAccessor : InputAccessor { std::map> mounts; - UnionInputAccessor(std::map> _mounts) + MountedInputAccessor(std::map> _mounts) : mounts(std::move(_mounts)) { // Currently we require a root filesystem. This could be relaxed. @@ -71,9 +71,9 @@ struct UnionInputAccessor : InputAccessor } }; -ref makeUnionInputAccessor(std::map> mounts) +ref makeMountedInputAccessor(std::map> mounts) { - return make_ref(std::move(mounts)); + return make_ref(std::move(mounts)); } } diff --git a/src/libfetchers/mounted-input-accessor.hh b/src/libfetchers/mounted-input-accessor.hh new file mode 100644 index 000000000..b557c5dad --- /dev/null +++ b/src/libfetchers/mounted-input-accessor.hh @@ -0,0 +1,9 @@ +#pragma once + +#include "input-accessor.hh" + +namespace nix { + +ref makeMountedInputAccessor(std::map> mounts); + +} diff --git a/src/libfetchers/union-input-accessor.hh b/src/libfetchers/union-input-accessor.hh deleted file mode 100644 index 6a1649c1d..000000000 --- a/src/libfetchers/union-input-accessor.hh +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "input-accessor.hh" - -namespace nix { - -ref makeUnionInputAccessor(std::map> mounts); - -}