diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-22 14:23:24 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-23 09:50:43 +0100 |
commit | d6eb885a3f205e00a3be9f2ae2e8f510cae15d8a (patch) | |
tree | dabb8e10973ae1d5f21f4c01bda72b3d1b68402d /src/other_tools/git_operations/git_repo_remote.cpp | |
parent | e0c38d7083e6c972a432bfff3a9863f251f2170c (diff) | |
download | justbuild-d6eb885a3f205e00a3be9f2ae2e8f510cae15d8a.tar.gz |
just-mr: Add git binary option
In the rare cases that we need to shell out to git, let the user
configure what binary to use. Option resolves in the same way as
the just executable, including allowing it to be set via just-mrrc.
Updates all cases of shelling out to git (fetch and commit update).
Update just-mr and just-mrrc docs accordingly.
Diffstat (limited to 'src/other_tools/git_operations/git_repo_remote.cpp')
-rw-r--r-- | src/other_tools/git_operations/git_repo_remote.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp index ab9d7ce2..8527a13c 100644 --- a/src/other_tools/git_operations/git_repo_remote.cpp +++ b/src/other_tools/git_operations/git_repo_remote.cpp @@ -390,6 +390,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( std::filesystem::path const& tmp_dir, std::string const& repo_url, std::string const& branch, + std::string const& git_bin, std::vector<std::string> const& launcher, anon_logger_ptr const& logger) const noexcept -> std::optional<std::string> { @@ -430,7 +431,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( } // default to shelling out to git for non-explicitly supported protocols auto cmdline = launcher; - cmdline.insert(cmdline.end(), {"git", "ls-remote", repo_url, branch}); + cmdline.insert(cmdline.end(), {git_bin, "ls-remote", repo_url, branch}); // set up the system command SystemCommand system{repo_url}; auto const command_output = @@ -494,6 +495,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( auto GitRepoRemote::FetchViaTmpRepo(std::filesystem::path const& tmp_dir, std::string const& repo_url, std::optional<std::string> const& branch, + std::string const& git_bin, std::vector<std::string> const& launcher, anon_logger_ptr const& logger) noexcept -> bool { @@ -550,7 +552,7 @@ auto GitRepoRemote::FetchViaTmpRepo(std::filesystem::path const& tmp_dir, // file. This however does not imply automatically that fetches // might not internally wait for each other through other means. cmdline.insert(cmdline.end(), - {"git", + {git_bin, "fetch", "--no-auto-gc", "--no-write-fetch-head", |