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. --- src/other_tools/root_maps/commit_git_map.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/other_tools/root_maps/commit_git_map.cpp') diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 08680531..3cf53cb4 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -511,6 +511,7 @@ void EnsureCommit( if (git_repo->FetchViaTmpRepo(tmp_dir->GetPath(), mirror, repo_info.branch, + repo_info.inherit_env, git_bin, launcher, wrapped_logger)) { @@ -543,6 +544,7 @@ void EnsureCommit( if (git_repo->FetchViaTmpRepo(tmp_dir->GetPath(), *preferred_url, repo_info.branch, + repo_info.inherit_env, git_bin, launcher, wrapped_logger)) { @@ -575,6 +577,7 @@ void EnsureCommit( if (git_repo->FetchViaTmpRepo(tmp_dir->GetPath(), fetch_repo, repo_info.branch, + repo_info.inherit_env, git_bin, launcher, wrapped_logger)) { @@ -610,6 +613,7 @@ void EnsureCommit( tmp_dir->GetPath(), *preferred_mirror, repo_info.branch, + repo_info.inherit_env, git_bin, launcher, wrapped_logger)) { @@ -645,6 +649,7 @@ void EnsureCommit( if (git_repo->FetchViaTmpRepo(tmp_dir->GetPath(), mirror, repo_info.branch, + repo_info.inherit_env, git_bin, launcher, wrapped_logger)) { -- cgit v1.2.3