diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-21 14:58:54 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-23 09:50:42 +0100 |
commit | 12d0c288ea23e1bd7e0401223ba413bca3d94869 (patch) | |
tree | b6e16385368863b11ba8656b7b651440c9f5783b /src/other_tools/ops_maps/git_update_map.cpp | |
parent | 17143ed02545efab55c175db66a9e31db4cce0f0 (diff) | |
download | justbuild-12d0c288ea23e1bd7e0401223ba413bca3d94869.tar.gz |
just-mr: Shell out to system Git for update commit from SSH remote...
...due to limitations in SSH support in libgit2. In this case, we
simply execute 'git ls-remote <repo> [<branch>]' and then parse
the output. Remote interogation requires no local repository, so
it is an asynchronious operation by default.
Diffstat (limited to 'src/other_tools/ops_maps/git_update_map.cpp')
-rw-r--r-- | src/other_tools/ops_maps/git_update_map.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/other_tools/ops_maps/git_update_map.cpp b/src/other_tools/ops_maps/git_update_map.cpp index c4305e69..f096d3a9 100644 --- a/src/other_tools/ops_maps/git_update_map.cpp +++ b/src/other_tools/ops_maps/git_update_map.cpp @@ -21,13 +21,14 @@ #include "src/other_tools/just_mr/utils.hpp" #include "src/utils/cpp/tmp_dir.hpp" -auto CreateGitUpdateMap(GitCASPtr const& git_cas, std::size_t jobs) - -> GitUpdateMap { - auto update_commits = [git_cas](auto /* unused */, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { +auto CreateGitUpdateMap(GitCASPtr const& git_cas, + std::vector<std::string> const& launcher, + std::size_t jobs) -> GitUpdateMap { + auto update_commits = [git_cas, launcher](auto /* unused */, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { // perform git update commit auto git_repo = GitRepoRemote::Open(git_cas); // wrap the tmp odb if (not git_repo) { @@ -55,8 +56,11 @@ auto CreateGitUpdateMap(GitCASPtr const& git_cas, std::size_t jobs) // update commit auto id = fmt::format("{}:{}", key.first, key.second); JustMRProgress::Instance().TaskTracker().Start(id); - auto new_commit = git_repo->UpdateCommitViaTmpRepo( - tmp_dir->GetPath(), key.first, key.second, wrapped_logger); + auto new_commit = git_repo->UpdateCommitViaTmpRepo(tmp_dir->GetPath(), + key.first, + key.second, + launcher, + wrapped_logger); JustMRProgress::Instance().TaskTracker().Stop(id); if (not new_commit) { return; |