diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-10-24 11:18:49 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-10-25 13:00:43 +0200 |
commit | 4018960c59d3fd0702c714e404ac913b2e83c3f5 (patch) | |
tree | 1de10348b25c7d6b9ea0f4de424b75f0cb7da11a /src/other_tools/just_mr/fetch.cpp | |
parent | 3d0003c7a61d77af534ef5d79a395849684518f7 (diff) | |
download | justbuild-4018960c59d3fd0702c714e404ac913b2e83c3f5.tar.gz |
serve service: Respond also with digest in serve repository tree RPCs
...besides the simple Git hash, if syncing was done. This way one
can know what digest to ask for from the remote. The serve client
also needs to now know what hash function the remote expects.
The serve service proto file is updated accordingly.
Diffstat (limited to 'src/other_tools/just_mr/fetch.cpp')
-rw-r--r-- | src/other_tools/just_mr/fetch.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index bdca1331..ace8cbda 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -422,10 +422,13 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config, ApiBundle{.hash_function = hash_fct, .local = native_local_api, .remote = has_remote_api ? remote_api : native_local_api}; - auto serve = ServeApi::Create(*serve_config, - &native_local_context, /*unused*/ - &remote_context, - &apis /*unused*/); + auto serve = ServeApi::Create( + *serve_config, + compat_local_context != nullptr + ? &*compat_local_context + : &native_local_context, // defines the client's hash_function + &remote_context, + &apis /*unused*/); // check configuration of the serve endpoint provided if (serve) { |