diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-05-26 15:06:49 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-06-06 09:55:17 +0200 |
commit | 3f41feb6e022a30cfce39ec40c7ffda46d75193d (patch) | |
tree | 24f8f8d5047582bd936b17d96e3f7b4b14020c79 /src/other_tools/root_maps/commit_git_map.cpp | |
parent | e4214ea95874bdd5bc059d0892f90c09df7b664d (diff) | |
download | justbuild-3f41feb6e022a30cfce39ec40c7ffda46d75193d.tar.gz |
style: Use designated initializers
This feature has been introduced with C++20.
Diffstat (limited to 'src/other_tools/root_maps/commit_git_map.cpp')
-rw-r--r-- | src/other_tools/root_maps/commit_git_map.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
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)}, |