diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-05 11:48:13 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-10 14:06:21 +0200 |
commit | 4fe5fc8aec6e391a5e300e234bdc41375bff1d9e (patch) | |
tree | d5eb3cb68f5d44fc89f885667cf6242b0d137a99 /src/buildtool/serve_api/serve_service/source_tree.hpp | |
parent | 43ac36b4cd2b6aa0b42219f5920a7b4e72832ae5 (diff) | |
download | justbuild-4fe5fc8aec6e391a5e300e234bdc41375bff1d9e.tar.gz |
resolve_symlinks_map: Allow separate source and target repositories
In certain cases, e.g., on the serve endpoint, an unresolved tree
might lie in a repository other than the Git cache, therefore we
cannot create any new entries there, as it would violate our
guarantee that we only write under our local build root.
Therefore, the resolve_symlinks_map now receives pointers to both
the source and target Git databases and ensures that:
1. any tree created on-the-fly is stored exclusively in the target
repository, and
2. any other entry required for those trees is made available in
the target repository by copying it from the source repository.
Note that in our use case the target repository is always our Git
cache and passing a pointer to that object database is done to
avoid the overhead of otherwise opening the database very often.
Diffstat (limited to 'src/buildtool/serve_api/serve_service/source_tree.hpp')
-rw-r--r-- | src/buildtool/serve_api/serve_service/source_tree.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/buildtool/serve_api/serve_service/source_tree.hpp b/src/buildtool/serve_api/serve_service/source_tree.hpp index f2585f40..d8d117e0 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.hpp +++ b/src/buildtool/serve_api/serve_service/source_tree.hpp @@ -173,9 +173,12 @@ class SourceTreeService final ServeArchiveTreeResponse* response) -> ::grpc::Status; + /// \brief Resolves a tree from given repository with respect to symlinks. + /// The resolved tree will always be placed in the Git cache. [[nodiscard]] auto ResolveContentTree( std::string const& tree_id, std::filesystem::path const& repo_path, + bool repo_is_git_cache, std::optional<PragmaSpecial> const& resolve_special, bool sync_tree, ServeArchiveTreeResponse* response) -> ::grpc::Status; |