diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-06-27 17:22:32 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-06-28 11:24:09 +0200 |
commit | ed7e81b9aefaa47e61983d14c2447bbd1f5c95c5 (patch) | |
tree | 366dc9ab8809cc05f4354c2007bd47281a7c2974 /src/other_tools/root_maps/commit_git_map.cpp | |
parent | 956ed669cf71d1ee74dbb573c542a7565c3a90d3 (diff) | |
download | justbuild-ed7e81b9aefaa47e61983d14c2447bbd1f5c95c5.tar.gz |
Use (un)expected for Git repo
Diffstat (limited to 'src/other_tools/root_maps/commit_git_map.cpp')
-rw-r--r-- | src/other_tools/root_maps/commit_git_map.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 22f85f35..a8ef5eaf 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -340,7 +340,7 @@ void NetworkFetchAndSetPresentRoot( // get tree id and return workspace root auto res = git_repo->GetSubtreeFromCommit( repo_info.hash, repo_info.subdir, wrapped_logger); - if (not std::holds_alternative<std::string>(res)) { + if (not res) { return; } // set the workspace root as present @@ -350,7 +350,7 @@ void NetworkFetchAndSetPresentRoot( {repo_info.ignore_special ? FileRoot::kGitTreeIgnoreSpecialMarker : FileRoot::kGitTreeMarker, - std::get<std::string>(res), // subtree id + *std::move(res), // subtree id repo_root}), /*is_cache_hit=*/false)); }, @@ -380,7 +380,7 @@ void NetworkFetchAndSetPresentRoot( // get tree id and return workspace root auto res = git_repo->GetSubtreeFromCommit( repo_info.hash, repo_info.subdir, wrapped_logger); - if (not std::holds_alternative<std::string>(res)) { + if (not res) { return; } // set the workspace root as present @@ -389,7 +389,7 @@ void NetworkFetchAndSetPresentRoot( nlohmann::json::array({repo_info.ignore_special ? FileRoot::kGitTreeIgnoreSpecialMarker : FileRoot::kGitTreeMarker, - std::get<std::string>(res), // subtree id + *std::move(res), // subtree id repo_root}), /*is_cache_hit=*/false)); } @@ -882,10 +882,10 @@ void EnsureCommit(GitRepoInfo const& repo_info, // get tree id and return workspace root auto res = git_repo->GetSubtreeFromCommit( repo_info.hash, repo_info.subdir, wrapped_logger); - if (not std::holds_alternative<std::string>(res)) { + if (not res) { return; } - auto subtree = std::get<std::string>(res); + auto subtree = *std::move(res); // set the workspace root if (repo_info.absent and not fetch_absent) { // try by all available means to generate and set the absent root |