summaryrefslogtreecommitdiff
path: root/src/other_tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools')
-rw-r--r--src/other_tools/git_operations/git_operations.cpp28
-rw-r--r--src/other_tools/git_operations/git_repo_remote.cpp3
-rw-r--r--src/other_tools/just_mr/main.cpp42
-rw-r--r--src/other_tools/just_mr/utils.hpp31
-rw-r--r--src/other_tools/ops_maps/import_to_git_map.cpp52
-rw-r--r--src/other_tools/repo_map/repos_to_setup_map.cpp106
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp34
-rw-r--r--src/other_tools/root_maps/content_git_map.cpp17
-rw-r--r--src/other_tools/root_maps/distdir_git_map.cpp17
-rw-r--r--src/other_tools/root_maps/fpath_git_map.cpp13
-rw-r--r--src/other_tools/root_maps/tree_id_git_map.cpp50
11 files changed, 194 insertions, 199 deletions
diff --git a/src/other_tools/git_operations/git_operations.cpp b/src/other_tools/git_operations/git_operations.cpp
index b68c54e7..f0f80a8d 100644
--- a/src/other_tools/git_operations/git_operations.cpp
+++ b/src/other_tools/git_operations/git_operations.cpp
@@ -30,7 +30,7 @@ auto CriticalGitOps::GitInitialCommit(GitOpParams const& crit_op_params,
(*logger)(fmt::format("could not initialize git repository {}",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// setup wrapped logger
auto wrapped_logger = std::make_shared<AsyncMapConsumerLogger>(
@@ -43,10 +43,10 @@ auto CriticalGitOps::GitInitialCommit(GitOpParams const& crit_op_params,
auto commit_hash = git_repo->StageAndCommitAllAnonymous(
crit_op_params.message.value(), wrapped_logger);
if (commit_hash == std::nullopt) {
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// success
- return GitOpValue({git_repo->GetGitCAS(), commit_hash.value()});
+ return {.git_cas = git_repo->GetGitCAS(), .result = commit_hash.value()};
}
auto CriticalGitOps::GitEnsureInit(GitOpParams const& crit_op_params,
@@ -57,7 +57,7 @@ auto CriticalGitOps::GitEnsureInit(GitOpParams const& crit_op_params,
(*logger)(fmt::format("target directory {} could not be created",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// Create and open a GitRepo at given target location
auto git_repo = GitRepoRemote::InitAndOpen(
@@ -69,10 +69,10 @@ auto CriticalGitOps::GitEnsureInit(GitOpParams const& crit_op_params,
crit_op_params.init_bare.value() ? "bare" : "non-bare",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// success
- return GitOpValue({git_repo->GetGitCAS(), ""});
+ return {.git_cas = git_repo->GetGitCAS(), .result = ""};
}
auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params,
@@ -83,7 +83,7 @@ auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params,
(*logger)(fmt::format("target directory {} does not exist!",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// Open a GitRepo at given location
auto git_repo = GitRepoRemote::Open(crit_op_params.target_path);
@@ -91,7 +91,7 @@ auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params,
(*logger)(fmt::format("could not open git repository {}",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// setup wrapped logger
auto wrapped_logger = std::make_shared<AsyncMapConsumerLogger>(
@@ -103,10 +103,10 @@ auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params,
if (not git_repo->KeepTag(crit_op_params.git_hash,
crit_op_params.message.value(),
wrapped_logger)) {
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// success
- return GitOpValue({git_repo->GetGitCAS(), ""});
+ return {.git_cas = git_repo->GetGitCAS(), .result = ""};
}
auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params,
@@ -117,7 +117,7 @@ auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params,
(*logger)(fmt::format("target directory {} does not exist!",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// Open a GitRepo at given location
auto git_repo = GitRepoRemote::Open(crit_op_params.target_path);
@@ -125,7 +125,7 @@ auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params,
(*logger)(fmt::format("could not open git repository {}",
crit_op_params.target_path.string()),
true /*fatal*/);
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// setup wrapped logger
auto wrapped_logger = std::make_shared<AsyncMapConsumerLogger>(
@@ -136,8 +136,8 @@ auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params,
// Get head commit
auto head_commit = git_repo->GetHeadCommit(wrapped_logger);
if (head_commit == std::nullopt) {
- return GitOpValue({nullptr, std::nullopt});
+ return {.git_cas = nullptr, .result = std::nullopt};
}
// success
- return GitOpValue({git_repo->GetGitCAS(), *head_commit});
+ return {.git_cas = git_repo->GetGitCAS(), .result = *head_commit};
}
diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp
index 0c925cc4..580375ec 100644
--- a/src/other_tools/git_operations/git_repo_remote.cpp
+++ b/src/other_tools/git_operations/git_repo_remote.cpp
@@ -531,7 +531,8 @@ auto GitRepoRemote::FetchViaTmpRepo(std::filesystem::path const& tmp_dir,
return false;
}
// add backend, with max priority
- FetchIntoODBBackend b{kFetchIntoODBParent, GetGitOdb().get()};
+ FetchIntoODBBackend b{.parent = kFetchIntoODBParent,
+ .target_odb = GetGitOdb().get()};
if (git_odb_add_backend(
tmp_repo->GetGitOdb().get(),
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index 33a09531..56ba4a18 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -790,26 +790,28 @@ void DefaultReachableRepositories(
(*resolved_repo_desc)
->Get("ignore_special", Expression::none_t{});
ArchiveRepoInfo archive_info = {
- {
- repo_desc_content->get()->String(), /* content */
- repo_desc_distfile->IsString()
- ? std::make_optional(repo_desc_distfile->String())
- : std::nullopt, /* distfile */
- repo_desc_fetch->get()->String(), /* fetch_url */
- repo_desc_sha256->IsString()
- ? std::make_optional(repo_desc_sha256->String())
- : std::nullopt, /* sha256 */
- repo_desc_sha512->IsString()
- ? std::make_optional(repo_desc_sha512->String())
- : std::nullopt, /* sha512 */
- repo_name, /* origin */
- false /* origin_from_distdir */
- }, /* archive */
- repo_type_str, /* repo_type */
- subdir.empty() ? "." : subdir.string(), /* subdir */
- repo_desc_ignore_special->IsBool()
- ? repo_desc_ignore_special->Bool()
- : false /* ignore_special */};
+ .archive = {.content = repo_desc_content->get()->String(),
+ .distfile =
+ repo_desc_distfile->IsString()
+ ? std::make_optional(
+ repo_desc_distfile->String())
+ : std::nullopt,
+ .fetch_url = repo_desc_fetch->get()->String(),
+ .sha256 = repo_desc_sha256->IsString()
+ ? std::make_optional(
+ repo_desc_sha256->String())
+ : std::nullopt,
+ .sha512 = repo_desc_sha512->IsString()
+ ? std::make_optional(
+ repo_desc_sha512->String())
+ : std::nullopt,
+ .origin = repo_name,
+ .origin_from_distdir = false},
+ .repo_type = repo_type_str,
+ .subdir = subdir.empty() ? "." : subdir.string(),
+ .ignore_special = repo_desc_ignore_special->IsBool()
+ ? repo_desc_ignore_special->Bool()
+ : false};
// add to list
repos_to_fetch.emplace_back(std::move(archive_info));
}
diff --git a/src/other_tools/just_mr/utils.hpp b/src/other_tools/just_mr/utils.hpp
index d992a895..5caf33d0 100644
--- a/src/other_tools/just_mr/utils.hpp
+++ b/src/other_tools/just_mr/utils.hpp
@@ -55,36 +55,21 @@ struct JustSubCmdFlags {
// ordered, so that we have replicability
std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{
{"version",
- {false /*config*/,
- false /*build_root*/,
- false /*launch*/,
- false /*defines*/}},
+ {.config = false, .build_root = false, .launch = false, .defines = false}},
{"describe",
- {true /*config*/,
- false /*build_root*/,
- false /*launch*/,
- true /*defines*/}},
+ {.config = true, .build_root = false, .launch = false, .defines = true}},
{"analyse",
- {true /*config*/,
- true /*build_root*/,
- false /*launch*/,
- true /*defines*/}},
+ {.config = true, .build_root = true, .launch = false, .defines = true}},
{"build",
- {true /*config*/, true /*build_root*/, true /*launch*/, true /*defines*/}},
+ {.config = true, .build_root = true, .launch = true, .defines = true}},
{"install",
- {true /*config*/, true /*build_root*/, true /*launch*/, true /*defines*/}},
+ {.config = true, .build_root = true, .launch = true, .defines = true}},
{"rebuild",
- {true /*config*/, true /*build_root*/, true /*launch*/, true /*defines*/}},
+ {.config = true, .build_root = true, .launch = true, .defines = true}},
{"install-cas",
- {false /*config*/,
- true /*build_root*/,
- false /*launch*/,
- false /*defines*/}},
+ {.config = false, .build_root = true, .launch = false, .defines = false}},
{"gc",
- {false /*config*/,
- true /*build_root*/,
- false /*launch*/,
- false /*defines*/}}};
+ {.config = false, .build_root = true, .launch = false, .defines = false}}};
nlohmann::json const kDefaultConfigLocations = nlohmann::json::array(
{{{"root", "workspace"}, {"path", "repos.json"}},
diff --git a/src/other_tools/ops_maps/import_to_git_map.cpp b/src/other_tools/ops_maps/import_to_git_map.cpp
index 42ec7c9b..e8b7a89d 100644
--- a/src/other_tools/ops_maps/import_to_git_map.cpp
+++ b/src/other_tools/ops_maps/import_to_git_map.cpp
@@ -31,13 +31,14 @@ void KeepCommitAndSetTree(
ImportToGitMap::SetterPtr const& setter,
ImportToGitMap::LoggerPtr const& logger) {
// Keep tag for commit
- GitOpKey op_key = {{
- StorageConfig::GitRoot(), // target_path
- commit, // git_hash
- "", // branch
- "Keep referenced tree alive" // message
- },
- GitOpType::KEEP_TAG};
+ GitOpKey op_key = {.params =
+ {
+ StorageConfig::GitRoot(), // target_path
+ commit, // git_hash
+ "", // branch
+ "Keep referenced tree alive" // message
+ },
+ .op_type = GitOpType::KEEP_TAG};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
@@ -96,15 +97,16 @@ auto CreateImportToGitMap(
auto /*unused*/,
auto const& key) {
// Perform initial commit at location: init + add . + commit
- GitOpKey op_key = {
- {
- key.target_path, // target_path
- "", // git_hash
- "", // branch
- fmt::format(
- "Content of {} {}", key.repo_type, key.content), // message
- },
- GitOpType::INITIAL_COMMIT};
+ GitOpKey op_key = {.params =
+ {
+ key.target_path, // target_path
+ "", // git_hash
+ "", // branch
+ fmt::format("Content of {} {}",
+ key.repo_type,
+ key.content), // message
+ },
+ .op_type = GitOpType::INITIAL_COMMIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
@@ -124,14 +126,16 @@ auto CreateImportToGitMap(
}
// ensure Git cache
// define Git operation to be done
- GitOpKey op_key = {{
- StorageConfig::GitRoot(), // target_path
- "", // git_hash
- "", // branch
- std::nullopt, // message
- true // init_bare
- },
- GitOpType::ENSURE_INIT};
+ GitOpKey op_key = {
+ .params =
+ {
+ StorageConfig::GitRoot(), // target_path
+ "", // git_hash
+ "", // branch
+ std::nullopt, // message
+ true // init_bare
+ },
+ .op_type = GitOpType::ENSURE_INIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
diff --git a/src/other_tools/repo_map/repos_to_setup_map.cpp b/src/other_tools/repo_map/repos_to_setup_map.cpp
index 0637b81d..d65386a3 100644
--- a/src/other_tools/repo_map/repos_to_setup_map.cpp
+++ b/src/other_tools/repo_map/repos_to_setup_map.cpp
@@ -95,14 +95,14 @@ void GitCheckout(ExpressionPtr const& repo_desc,
repo_desc->Get("ignore_special", Expression::none_t{});
// populate struct
GitRepoInfo git_repo_info = {
- repo_desc_commit->get()->String(), /* hash */
- repo_desc_repository->get()->String(), /* repo_url */
- repo_desc_branch->get()->String(), /* branch */
- subdir.empty() ? "." : subdir.string(), /* subdir */
- repo_name, /* origin */
- repo_desc_ignore_special->IsBool() ? repo_desc_ignore_special->Bool()
- : false /* ignore_special */
- };
+ .hash = repo_desc_commit->get()->String(),
+ .repo_url = repo_desc_repository->get()->String(),
+ .branch = repo_desc_branch->get()->String(),
+ .subdir = subdir.empty() ? "." : subdir.string(),
+ .origin = repo_name,
+ .ignore_special = repo_desc_ignore_special->IsBool()
+ ? repo_desc_ignore_special->Bool()
+ : false};
// get the WS root as git tree
commit_git_map->ConsumeAfterKeysReady(
ts,
@@ -178,26 +178,25 @@ void ArchiveCheckout(ExpressionPtr const& repo_desc,
repo_desc->Get("ignore_special", Expression::none_t{});
// populate struct
ArchiveRepoInfo archive_repo_info = {
- {
- repo_desc_content->get()->String(), /* content */
- repo_desc_distfile->IsString()
- ? std::make_optional(repo_desc_distfile->String())
- : std::nullopt, /* distfile */
- repo_desc_fetch->get()->String(), /* fetch_url */
- repo_desc_sha256->IsString()
- ? std::make_optional(repo_desc_sha256->String())
- : std::nullopt, /* sha256 */
- repo_desc_sha512->IsString()
- ? std::make_optional(repo_desc_sha512->String())
- : std::nullopt, /* sha512 */
- repo_name, /* origin */
- false /* origin_from_distdir */
- }, /* archive */
- repo_type, /* repo_type */
- subdir.empty() ? "." : subdir.string(), /* subdir */
- repo_desc_ignore_special->IsBool() ? repo_desc_ignore_special->Bool()
- : false /* ignore_special */
- };
+ .archive =
+ {.content = repo_desc_content->get()->String(),
+ .distfile = repo_desc_distfile->IsString()
+ ? std::make_optional(repo_desc_distfile->String())
+ : std::nullopt,
+ .fetch_url = repo_desc_fetch->get()->String(),
+ .sha256 = repo_desc_sha256->IsString()
+ ? std::make_optional(repo_desc_sha256->String())
+ : std::nullopt,
+ .sha512 = repo_desc_sha512->IsString()
+ ? std::make_optional(repo_desc_sha512->String())
+ : std::nullopt,
+ .origin = repo_name,
+ .origin_from_distdir = false},
+ .repo_type = repo_type,
+ .subdir = subdir.empty() ? "." : subdir.string(),
+ .ignore_special = repo_desc_ignore_special->IsBool()
+ ? repo_desc_ignore_special->Bool()
+ : false};
// get the WS root as git tree
content_git_map->ConsumeAfterKeysReady(
ts,
@@ -432,20 +431,20 @@ void DistdirCheckout(ExpressionPtr const& repo_desc,
(*resolved_repo_desc)->Get("sha512", Expression::none_t{});
ArchiveContent archive = {
- repo_desc_content->get()->String(), /* content */
- repo_desc_distfile->IsString()
- ? std::make_optional(repo_desc_distfile->String())
- : std::nullopt, /* distfile */
- repo_desc_fetch->get()->String(), /* fetch_url */
- repo_desc_sha256->IsString()
- ? std::make_optional(repo_desc_sha256->String())
- : std::nullopt, /* sha256 */
- repo_desc_sha512->IsString()
- ? std::make_optional(repo_desc_sha512->String())
- : std::nullopt, /* sha512 */
- dist_repo_name, /* origin */
- true /* origin_from_distdir */
- }; /* archive */
+ .content = repo_desc_content->get()->String(),
+ .distfile =
+ repo_desc_distfile->IsString()
+ ? std::make_optional(repo_desc_distfile->String())
+ : std::nullopt,
+ .fetch_url = repo_desc_fetch->get()->String(),
+ .sha256 = repo_desc_sha256->IsString()
+ ? std::make_optional(repo_desc_sha256->String())
+ : std::nullopt,
+ .sha512 = repo_desc_sha512->IsString()
+ ? std::make_optional(repo_desc_sha512->String())
+ : std::nullopt,
+ .origin = dist_repo_name,
+ .origin_from_distdir = true};
// add to distdir content map
auto repo_distfile =
@@ -463,13 +462,11 @@ void DistdirCheckout(ExpressionPtr const& repo_desc,
HashFunction::ComputeBlobHash(nlohmann::json(*distdir_content).dump())
.HexString();
// get the WS root as git tree
- DistdirInfo distdir_info = {
- distdir_content_id, /* content_id */
- distdir_content, /* content_list */
- dist_repos_to_fetch, /* repos_to_fetch */
- repo_name, /* origin */
- ignore_special /* ignore_special */
- };
+ DistdirInfo distdir_info = {.content_id = distdir_content_id,
+ .content_list = distdir_content,
+ .repos_to_fetch = dist_repos_to_fetch,
+ .origin = repo_name,
+ .ignore_special = ignore_special};
distdir_git_map->ConsumeAfterKeysReady(
ts,
{std::move(distdir_info)},
@@ -568,13 +565,10 @@ void GitTreeCheckout(ExpressionPtr const& repo_desc,
? repo_desc_ignore_special->Bool()
: false;
// populate struct
- TreeIdInfo tree_id_info = {
- repo_desc_hash->get()->String(), /* hash */
- std::move(env), /* env_vars */
- std::move(cmd), /* command */
- repo_name, /* origin */
- ignore_special /* ignore_special */
- };
+ TreeIdInfo tree_id_info = {.hash = repo_desc_hash->get()->String(),
+ .env_vars = std::move(env),
+ .command = std::move(cmd),
+ .ignore_special = ignore_special};
// get the WS root as git tree
tree_id_git_map->ConsumeAfterKeysReady(
ts,
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp
index 3ae98331..5a2f831e 100644
--- a/src/other_tools/root_maps/commit_git_map.cpp
+++ b/src/other_tools/root_maps/commit_git_map.cpp
@@ -107,13 +107,14 @@ void EnsureCommit(GitRepoInfo const& repo_info,
return;
}
// keep tag
- GitOpKey op_key = {{
- repo_root, // target_path
- repo_info.hash, // git_hash
- "", // branch
- "Keep referenced tree alive" // message
- },
- GitOpType::KEEP_TAG};
+ GitOpKey op_key = {.params =
+ {
+ repo_root, // target_path
+ repo_info.hash, // git_hash
+ "", // branch
+ "Keep referenced tree alive" // message
+ },
+ .op_type = GitOpType::KEEP_TAG};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
@@ -221,15 +222,16 @@ auto CreateCommitGitMap(
// ensure git repo
// define Git operation to be done
GitOpKey op_key = {
- {
- repo_root, // target_path
- "", // git_hash
- "", // branch
- std::nullopt, // message
- not just_mr_paths->git_checkout_locations.contains(
- fetch_repo) // init_bare
- },
- GitOpType::ENSURE_INIT};
+ .params =
+ {
+ repo_root, // target_path
+ "", // git_hash
+ "", // branch
+ std::nullopt, // message
+ not just_mr_paths->git_checkout_locations.contains(
+ fetch_repo) // init_bare
+ },
+ .op_type = GitOpType::ENSURE_INIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp
index b7a3c25e..aeea9e1e 100644
--- a/src/other_tools/root_maps/content_git_map.cpp
+++ b/src/other_tools/root_maps/content_git_map.cpp
@@ -69,14 +69,15 @@ auto CreateContentGitMap(
}
// ensure Git cache
// define Git operation to be done
- GitOpKey op_key = {{
- StorageConfig::GitRoot(), // target_path
- "", // git_hash
- "", // branch
- std::nullopt, // message
- true // init_bare
- },
- GitOpType::ENSURE_INIT};
+ GitOpKey op_key = {.params =
+ {
+ StorageConfig::GitRoot(), // target_path
+ "", // git_hash
+ "", // branch
+ std::nullopt, // message
+ true // init_bare
+ },
+ .op_type = GitOpType::ENSURE_INIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
diff --git a/src/other_tools/root_maps/distdir_git_map.cpp b/src/other_tools/root_maps/distdir_git_map.cpp
index db0e8ee9..78539158 100644
--- a/src/other_tools/root_maps/distdir_git_map.cpp
+++ b/src/other_tools/root_maps/distdir_git_map.cpp
@@ -78,14 +78,15 @@ auto CreateDistdirGitMap(
}
// ensure Git cache
// define Git operation to be done
- GitOpKey op_key = {{
- StorageConfig::GitRoot(), // target_path
- "", // git_hash
- "", // branch
- std::nullopt, // message
- true // init_bare
- },
- GitOpType::ENSURE_INIT};
+ GitOpKey op_key = {.params =
+ {
+ StorageConfig::GitRoot(), // target_path
+ "", // git_hash
+ "", // branch
+ std::nullopt, // message
+ true // init_bare
+ },
+ .op_type = GitOpType::ENSURE_INIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp
index 262d2b77..e7946e71 100644
--- a/src/other_tools/root_maps/fpath_git_map.cpp
+++ b/src/other_tools/root_maps/fpath_git_map.cpp
@@ -62,12 +62,13 @@ auto CreateFilePathGitMap(
return;
}
// get head commit
- GitOpKey op_key = {{
- *repo_root, // target_path
- "", // git_hash
- "", // branch
- },
- GitOpType::GET_HEAD_ID};
+ GitOpKey op_key = {.params =
+ {
+ *repo_root, // target_path
+ "", // git_hash
+ "", // branch
+ },
+ .op_type = GitOpType::GET_HEAD_ID};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
diff --git a/src/other_tools/root_maps/tree_id_git_map.cpp b/src/other_tools/root_maps/tree_id_git_map.cpp
index 27474c52..920ed615 100644
--- a/src/other_tools/root_maps/tree_id_git_map.cpp
+++ b/src/other_tools/root_maps/tree_id_git_map.cpp
@@ -36,13 +36,14 @@ void KeepCommitAndSetRoot(
TreeIdGitMap::SetterPtr const& ws_setter,
TreeIdGitMap::LoggerPtr const& logger) {
// Keep tag for commit
- GitOpKey op_key = {{
- StorageConfig::GitRoot(), // target_path
- commit, // git_hash
- "", // branch
- "Keep referenced tree alive" // message
- },
- GitOpType::KEEP_TAG};
+ GitOpKey op_key = {.params =
+ {
+ StorageConfig::GitRoot(), // target_path
+ commit, // git_hash
+ "", // branch
+ "Keep referenced tree alive" // message
+ },
+ .op_type = GitOpType::KEEP_TAG};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
@@ -95,14 +96,15 @@ auto CreateTreeIdGitMap(
// first, check whether tree exists already in CAS
// ensure Git cache
// define Git operation to be done
- GitOpKey op_key = {{
- StorageConfig::GitRoot(), // target_path
- "", // git_hash
- "", // branch
- std::nullopt, // message
- true // init_bare
- },
- GitOpType::ENSURE_INIT};
+ GitOpKey op_key = {.params =
+ {
+ StorageConfig::GitRoot(), // target_path
+ "", // git_hash
+ "", // branch
+ std::nullopt, // message
+ true // init_bare
+ },
+ .op_type = GitOpType::ENSURE_INIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
@@ -177,14 +179,16 @@ auto CreateTreeIdGitMap(
}
// do an import to git with tree check
- GitOpKey op_key = {{
- tmp_dir->GetPath(), // target_path
- "", // git_hash
- "", // branch
- fmt::format("Content of tree {}",
- key.hash), // message
- },
- GitOpType::INITIAL_COMMIT};
+ GitOpKey op_key = {
+ .params =
+ {
+ tmp_dir->GetPath(), // target_path
+ "", // git_hash
+ "", // branch
+ fmt::format("Content of tree {}",
+ key.hash), // message
+ },
+ .op_type = GitOpType::INITIAL_COMMIT};
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},