From 17143ed02545efab55c175db66a9e31db4cce0f0 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 21 Mar 2023 14:02:44 +0100 Subject: just-mr: Shell out to system Git for fetches over SSH... ...due to limited SSH support in libgit2. In order to allow the fetches to still be parallel, we execute: git fetch --no-auto-gc --no-write-fetch-head [] This only fetches the packs without updating any refs, at the slight cost of sometimes fetching some redundant information, which for our purposes is practically a non-issue. (If really needed, a 'git gc' call can be done eventually to try to compact the fetched packs, although a save in disk space is not actually guaranteed.) --- .../git_operations/git_repo_remote.test.cpp | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 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 6850355e..1cdf643d 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -244,11 +244,12 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { CHECK_FALSE( *repo_fetch_all->CheckCommitExists(kRootCommit, logger)); - // create path for tmp repo to use for fetch + // create tmp dir to use for fetch auto tmp_path_fetch_all = TestUtils::GetRepoPath(); - // fetch with base refspecs + 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)); + tmp_path_fetch_all, *repo_path, std::nullopt, {}, logger)); // check commit is there after fetch CHECK(*repo_fetch_all->CheckCommitExists(kRootCommit, logger)); @@ -265,11 +266,13 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { CHECK_FALSE( *repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger)); - // create path for tmp repo to use for fetch + // create tmp dir to use for fetch auto tmp_path_fetch_wRefspec = TestUtils::GetRepoPath(); + REQUIRE( + FileSystemManager::CreateDirectory(tmp_path_fetch_wRefspec)); // fetch all REQUIRE(repo_fetch_wRefspec->FetchViaTmpRepo( - tmp_path_fetch_wRefspec, *repo_path, "master", logger)); + tmp_path_fetch_wRefspec, *repo_path, "master", {}, logger)); // check commit is there after fetch CHECK(*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger)); @@ -345,24 +348,30 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") { // something } break; case 1: { - // create path for tmp repo to use for fetch + // create tmp dir to use for fetch auto tmp_path_fetch_all = TestUtils::GetRepoPath(); + REQUIRE(FileSystemManager::CreateDirectory( + tmp_path_fetch_all)); // fetch with base refspecs CHECK( target_repo->FetchViaTmpRepo(tmp_path_fetch_all, *remote_repo_path, std::nullopt, + {}, logger)); } break; case 2: { - // create path for tmp repo to use for fetch + // create tmp dir to use for fetch auto tmp_path_fetch_wRefspec = TestUtils::GetRepoPath(); + REQUIRE(FileSystemManager::CreateDirectory( + tmp_path_fetch_wRefspec)); // fetch specific branch CHECK(target_repo->FetchViaTmpRepo( tmp_path_fetch_wRefspec, *remote_repo_path, "master", + {}, logger)); } break; case 3: { -- cgit v1.2.3