From a7cc305a3a6e2886a4f7ec7b8fd9943ff45f286d Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 20 Feb 2024 12:00:57 +0100 Subject: git repo fetch: support "inherit env" When fetching git repositories, just-mr routinely shells out to git. In this case, allow the user to specify via "inherit env", which environment variables from the host environment should be made available in this action. Typical variables to inherit are ones providing credentials, like SSH_AUTH_SOCK. As the repository description specifies the commit that will be taken, and hence the resulting tree, correctness is not affected by the environement leaking in here. --- test/other_tools/git_operations/git_repo_remote.test.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/other_tools/git_operations') 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 37be3737..03df8553 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -247,6 +247,7 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { REQUIRE(repo_fetch_all->FetchViaTmpRepo(tmp_path_fetch_all, *repo_path, std::nullopt, + {}, "git", {}, logger)); @@ -275,6 +276,7 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { repo_fetch_wRefspec->FetchViaTmpRepo(tmp_path_fetch_wRefspec, *repo_path, "master", + {}, "git", {}, logger)); @@ -295,7 +297,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", "git", {}, logger); + tmp_path_commit_upd, *repo_path, "master", {}, "git", {}, logger); REQUIRE(fetched_commit); CHECK(*fetched_commit == kRootCommit); @@ -363,6 +365,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)); @@ -378,6 +381,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") { tmp_path_fetch_wRefspec, *remote_repo_path, "master", + {}, "git", {}, logger)); @@ -393,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