From 551ee670bf6a82683be0af5e440a8a9a3d08a7c7 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 11 Nov 2022 21:19:27 +0200 Subject: [PATCH] rollback cwd parameter for clone --- src/ahriman/core/build_tools/sources.py | 2 +- tests/ahriman/core/build_tools/test_sources.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ahriman/core/build_tools/sources.py b/src/ahriman/core/build_tools/sources.py index 0c8f2e44..620256c2 100644 --- a/src/ahriman/core/build_tools/sources.py +++ b/src/ahriman/core/build_tools/sources.py @@ -86,7 +86,7 @@ class Sources(LazyLogging): elif remote is not None: instance.logger.info("clone remote %s to %s using branch %s", remote.git_url, sources_dir, branch) Sources._check_output("git", "clone", "--branch", branch, "--single-branch", - remote.git_url, str(sources_dir), logger=instance.logger) + remote.git_url, str(sources_dir), cwd=sources_dir.parent, logger=instance.logger) else: # it will cause an exception later instance.logger.error("%s is not initialized, but no remote provided", sources_dir) diff --git a/tests/ahriman/core/build_tools/test_sources.py b/tests/ahriman/core/build_tools/test_sources.py index 5111e89c..f4d5b3bc 100644 --- a/tests/ahriman/core/build_tools/test_sources.py +++ b/tests/ahriman/core/build_tools/test_sources.py @@ -75,7 +75,7 @@ def test_fetch_new(remote_source: RemoteSource, mocker: MockerFixture) -> None: Sources.fetch(local, remote_source) check_output_mock.assert_has_calls([ MockCall("git", "clone", "--branch", remote_source.branch, "--single-branch", - remote_source.git_url, str(local), logger=pytest.helpers.anyvar(int)), + remote_source.git_url, str(local), cwd=local.parent, logger=pytest.helpers.anyvar(int)), MockCall("git", "checkout", "--force", remote_source.branch, cwd=local, logger=pytest.helpers.anyvar(int)), MockCall("git", "reset", "--hard", f"origin/{remote_source.branch}", cwd=local, logger=pytest.helpers.anyvar(int))