summaryrefslogtreecommitdiff
path: root/src/other_tools
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-05-26 14:46:25 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-06-04 14:34:44 +0200
commit811e9be4cc9604dba3d768639444c0d9f849a3c7 (patch)
tree15460350b2554be422b76c0cc817a4e5d8a1421e /src/other_tools
parent8d4f583d63c657397583f778096b8bcb6d96c12f (diff)
downloadjustbuild-811e9be4cc9604dba3d768639444c0d9f849a3c7.tar.gz
RepositoryConfig: Give access to a persistent storage config...
...whenever it is given access to a Git repository. The referenced storage config needs to outlive the repository config instance.
Diffstat (limited to 'src/other_tools')
-rw-r--r--src/other_tools/ops_maps/git_tree_fetch_map.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
index 9a539a51..34c693a7 100644
--- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp
+++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
@@ -41,17 +41,18 @@
namespace {
void BackupToRemote(ArtifactDigest const& digest,
- StorageConfig const& native_storage_config,
+ StorageConfig const* native_storage_config,
StorageConfig const* compat_storage_config,
gsl::not_null<IExecutionApi const*> const& local_api,
IExecutionApi const& remote_api,
GitTreeFetchMap::LoggerPtr const& logger) {
// try to back up to remote CAS
auto repo = RepositoryConfig{};
- if (repo.SetGitCAS(native_storage_config.GitRoot())) {
+ if (repo.SetGitCAS(native_storage_config->GitRoot(),
+ native_storage_config)) {
auto git_api =
MRGitApi{&repo,
- &native_storage_config,
+ native_storage_config,
compat_storage_config,
compat_storage_config != nullptr ? &*local_api : nullptr};
if (git_api.RetrieveToCas(
@@ -123,7 +124,7 @@ void MoveCASTreeToGit(
// back up only native digests, as that is what Git stores
auto const native_digest = ArtifactDigest{tree_hash, 0};
BackupToRemote(native_digest,
- *native_storage_config,
+ native_storage_config,
compat_storage_config,
local_api,
*remote_api,
@@ -180,7 +181,7 @@ void TagAndSetRoot(
// backup to remote if needed and in compatibility mode
if (backup_to_remote and remote_api != nullptr) {
BackupToRemote(digest,
- *native_storage_config,
+ native_storage_config,
compat_storage_config,
local_api,
*remote_api,
@@ -378,7 +379,7 @@ auto CreateGitTreeFetchMap(
// backup to remote if needed
if (backup_to_remote and remote_api != nullptr) {
BackupToRemote(ArtifactDigest{key.tree_hash, 0},
- *native_storage_config,
+ native_storage_config,
compat_storage_config,
local_api,
*remote_api,
@@ -732,7 +733,7 @@ auto CreateGitTreeFetchMap(
remote_api != nullptr) {
BackupToRemote(
ArtifactDigest{key.tree_hash, 0},
- *native_storage_config,
+ native_storage_config,
compat_storage_config,
local_api,
*remote_api,