summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/commit_git_map.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-01-23 12:22:53 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-01-24 15:47:30 +0100
commit02ff78ee73bb8df43e78450ec379b5b006126d73 (patch)
treed3988669c8ce1772989069cdb9955ec696e56273 /src/other_tools/root_maps/commit_git_map.cpp
parent794dc72077f2ababbf11ed50660a7832c9d7fac7 (diff)
downloadjustbuild-02ff78ee73bb8df43e78450ec379b5b006126d73.tar.gz
commit_git_map: Clean up passed arguments in EnsureCommit
Diffstat (limited to 'src/other_tools/root_maps/commit_git_map.cpp')
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp26
1 files changed, 10 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 d0b10258..8e34be91 100644
--- a/src/other_tools/root_maps/commit_git_map.cpp
+++ b/src/other_tools/root_maps/commit_git_map.cpp
@@ -65,13 +65,8 @@ auto CreateCommitGitMap(
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
- [key,
- fetch_repo,
- repo_root,
- critical_git_op_map,
- ts,
- setter,
- logger](auto const& values) {
+ [key, repo_root, critical_git_op_map, ts, setter, logger](
+ auto const& values) {
GitOpValue op_result = *values[0];
// check flag
if (not op_result.result) {
@@ -90,7 +85,6 @@ auto CreateCommitGitMap(
fatal);
});
EnsureCommit(key,
- fetch_repo,
repo_root,
op_result.git_cas,
critical_git_op_map,
@@ -110,7 +104,6 @@ auto CreateCommitGitMap(
}
void EnsureCommit(GitRepoInfo const& repo_info,
- std::string const& fetch_repo,
std::filesystem::path const& repo_root,
GitCASPtr const& git_cas,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
@@ -151,7 +144,6 @@ void EnsureCommit(GitRepoInfo const& repo_info,
[critical_git_op_map,
git_cas,
repo_info,
- fetch_repo,
repo_root,
ts,
ws_setter,
@@ -187,7 +179,7 @@ void EnsureCommit(GitRepoInfo const& repo_info,
fatal);
});
if (not git_repo->FetchViaTmpRepo(tmp_dir->GetPath(),
- fetch_repo,
+ repo_info.repo_url,
*op_result.result,
wrapped_logger)) {
return;
@@ -207,11 +199,13 @@ void EnsureCommit(GitRepoInfo const& repo_info,
}
if (not *is_commit_present) {
// commit could not be fetched, so fail
- (*logger)(fmt::format("Could not update commit from branch "
- "{} for remote {}",
- repo_info.branch,
- fetch_repo),
- /*fatal=*/true);
+ (*logger)(
+ fmt::format("Could not fetch commit {} from branch "
+ "{} for remote {}",
+ repo_info.hash,
+ repo_info.branch,
+ repo_info.repo_url),
+ /*fatal=*/true);
return;
}
// keep tag