From 4018960c59d3fd0702c714e404ac913b2e83c3f5 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 24 Oct 2024 11:18:49 +0200 Subject: 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. --- src/other_tools/just_mr/fetch.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/other_tools/just_mr/fetch.cpp') 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 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) { -- cgit v1.2.3