From d6eb885a3f205e00a3be9f2ae2e8f510cae15d8a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 22 Mar 2023 14:23:24 +0100 Subject: 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. --- .../git_operations/git_repo_remote.test.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'test/other_tools/git_operations/git_repo_remote.test.cpp') diff --git a/test/other_tools/git_operations/git_repo_remote.test.cpp b/test/other_tools/git_operations/git_repo_remote.test.cpp index ae3f2e05..5e4f9f9e 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -248,8 +248,12 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { auto tmp_path_fetch_all = TestUtils::GetRepoPath(); REQUIRE(FileSystemManager::CreateDirectory(tmp_path_fetch_all)); // fetch all with base refspecs - REQUIRE(repo_fetch_all->FetchViaTmpRepo( - tmp_path_fetch_all, *repo_path, std::nullopt, {}, logger)); + REQUIRE(repo_fetch_all->FetchViaTmpRepo(tmp_path_fetch_all, + *repo_path, + std::nullopt, + "git", + {}, + logger)); // check commit is there after fetch CHECK(*repo_fetch_all->CheckCommitExists(kRootCommit, logger)); @@ -271,8 +275,13 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { REQUIRE( FileSystemManager::CreateDirectory(tmp_path_fetch_wRefspec)); // fetch all - REQUIRE(repo_fetch_wRefspec->FetchViaTmpRepo( - tmp_path_fetch_wRefspec, *repo_path, "master", {}, logger)); + REQUIRE( + repo_fetch_wRefspec->FetchViaTmpRepo(tmp_path_fetch_wRefspec, + *repo_path, + "master", + "git", + {}, + logger)); // check commit is there after fetch CHECK(*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger)); @@ -290,7 +299,7 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { REQUIRE(FileSystemManager::CreateDirectory(tmp_path_commit_upd)); // do remote ls auto fetched_commit = repo_commit_upd->UpdateCommitViaTmpRepo( - tmp_path_commit_upd, *repo_path, "master", {}, logger); + tmp_path_commit_upd, *repo_path, "master", "git", {}, logger); REQUIRE(fetched_commit); CHECK(*fetched_commit == kRootCommit); @@ -358,6 +367,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") { target_repo->FetchViaTmpRepo(tmp_path_fetch_all, *remote_repo_path, std::nullopt, + "git", {}, logger)); } break; @@ -372,6 +382,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") { tmp_path_fetch_wRefspec, *remote_repo_path, "master", + "git", {}, logger)); } break; @@ -386,6 +397,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") { tmp_path_commit_upd, *remote_repo_path, "master", + "git", {}, logger); -- cgit v1.2.3