summaryrefslogtreecommitdiff
path: root/test/other_tools/git_operations
diff options
context:
space:
mode:
Diffstat (limited to 'test/other_tools/git_operations')
-rw-r--r--test/other_tools/git_operations/git_repo_remote.test.cpp63
1 files changed, 13 insertions, 50 deletions
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 03df8553..0330e9be 100644
--- a/test/other_tools/git_operations/git_repo_remote.test.cpp
+++ b/test/other_tools/git_operations/git_repo_remote.test.cpp
@@ -240,17 +240,9 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") {
CHECK_FALSE(
*repo_fetch_all->CheckCommitExists(kRootCommit, logger));
- // create tmp dir to use for fetch
- 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,
- {},
- "git",
- {},
- logger));
+ REQUIRE(repo_fetch_all->FetchViaTmpRepo(
+ *repo_path, std::nullopt, {}, "git", {}, logger));
// check commit is there after fetch
CHECK(*repo_fetch_all->CheckCommitExists(kRootCommit, logger));
@@ -267,19 +259,9 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") {
CHECK_FALSE(
*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger));
- // 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",
- {},
- "git",
- {},
- logger));
+ REQUIRE(repo_fetch_wRefspec->FetchViaTmpRepo(
+ *repo_path, "master", {}, "git", {}, logger));
// check commit is there after fetch
CHECK(*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger));
@@ -292,12 +274,9 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") {
GitRepoRemote::InitAndOpen(path_commit_upd, /*is_bare=*/true);
REQUIRE(repo_commit_upd);
- // create tmp dir to use for commits update
- auto tmp_path_commit_upd = TestUtils::GetRepoPath();
- REQUIRE(FileSystemManager::CreateDirectory(tmp_path_commit_upd));
// do remote ls
auto fetched_commit = repo_commit_upd->UpdateCommitViaTmpRepo(
- tmp_path_commit_upd, *repo_path, "master", {}, "git", {}, logger);
+ *repo_path, "master", {}, "git", {}, logger);
REQUIRE(fetched_commit);
CHECK(*fetched_commit == kRootCommit);
@@ -356,14 +335,9 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") {
// something
} break;
case 1: {
- // 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,
+ target_repo->FetchViaTmpRepo(*remote_repo_path,
std::nullopt,
{},
"git",
@@ -371,30 +345,19 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") {
logger));
} break;
case 2: {
- // 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",
- {},
- "git",
- {},
- logger));
+ CHECK(
+ target_repo->FetchViaTmpRepo(*remote_repo_path,
+ "master",
+ {},
+ "git",
+ {},
+ logger));
} break;
case 3: {
- // create tmp dir to use for commits update
- auto tmp_path_commit_upd = TestUtils::GetRepoPath();
- REQUIRE(FileSystemManager::CreateDirectory(
- tmp_path_commit_upd));
// do remote ls
auto fetched_commit =
target_repo->UpdateCommitViaTmpRepo(
- tmp_path_commit_upd,
*remote_repo_path,
"master",
{},