diff options
Diffstat (limited to 'src/other_tools/just_mr/update.cpp')
-rw-r--r-- | src/other_tools/just_mr/update.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/other_tools/just_mr/update.cpp b/src/other_tools/just_mr/update.cpp index 885f5421..a768e0e0 100644 --- a/src/other_tools/just_mr/update.cpp +++ b/src/other_tools/just_mr/update.cpp @@ -56,7 +56,7 @@ auto MultiRepoUpdate(std::shared_ptr<Configuration> const& config, return kExitUpdateError; } // gather repos to update - std::vector<std::pair<std::string, std::string>> repos_to_update{}; + std::vector<RepoDescriptionForUpdating> repos_to_update{}; repos_to_update.reserve(update_args.repos_to_update.size()); for (auto const& repo_name : update_args.repos_to_update) { auto repo_desc_parent = repos->At(repo_name); @@ -142,9 +142,33 @@ auto MultiRepoUpdate(std::shared_ptr<Configuration> const& config, nlohmann::json(repo_name).dump()); return kExitUpdateError; } - repos_to_update.emplace_back( - std::make_pair(repo_desc_repository->get()->String(), - repo_desc_branch->get()->String())); + std::vector<std::string> inherit_env{}; + auto repo_desc_inherit_env = + (*resolved_repo_desc) + ->Get("inherit env", Expression::kEmptyList); + if (not repo_desc_inherit_env->IsList()) { + Logger::Log(LogLevel::Error, + "GitCheckout: optional field \"inherit env\" " + "should be a list of strings, but found {}", + repo_desc_inherit_env->ToString()); + return kExitUpdateError; + } + for (auto const& var : repo_desc_inherit_env->List()) { + if (not var->IsString()) { + Logger::Log( + LogLevel::Error, + "GitCheckout: optional field \"inherit env\" " + "should be a list of strings, but found entry {}", + var->ToString()); + return kExitUpdateError; + } + inherit_env.emplace_back(var->String()); + } + + repos_to_update.emplace_back(RepoDescriptionForUpdating{ + .repo = repo_desc_repository->get()->String(), + .branch = repo_desc_branch->get()->String(), + .inherit_env = inherit_env}); } else { Logger::Log(LogLevel::Error, |