Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tmt/libraries/beakerlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from tmt.container import container, simple_field
from tmt.convert import write
from tmt.steps.discover import Discover
from tmt.utils import Command, Environment, EnvVarValue, Path
from tmt.utils import Command, Path

from . import Library, LibraryError

Expand Down Expand Up @@ -363,14 +363,10 @@ def _do_fetch(self, directory: Path) -> None:
else:
self.parent.debug(f"Cloning '{self.identifier}' for '{self}'.", level=3)

environment = Environment.from_environ()
environment["GIT_ASKPASS"] = EnvVarValue("echo")

tmt.utils.git.git_clone(
url=self.url,
destination=clone_dir,
shallow=self.ref is None,
environment=environment,
logger=self._logger,
)
self._git_clone_cache[clone_dir] = self
Expand Down
6 changes: 1 addition & 5 deletions tmt/steps/discover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import tmt.utils.url
from tmt.plugins import PluginRegistry
from tmt.steps import Action
from tmt.utils import Command, Environment, EnvVarValue, GeneralError, Path
from tmt.utils import Command, GeneralError, Path


def normalize_ref(
Expand Down Expand Up @@ -285,14 +285,10 @@ def _fetch_remote_source(self, url: str) -> Optional[Path]:
if self.data.url_content_type == "git":
self.debug(f"Clone '{url}' to '{self.test_dir}'.")

environment = Environment.from_environ()
environment["GIT_ASKPASS"] = EnvVarValue("echo")

tmt.utils.git.git_clone(
url=url,
destination=self.test_dir,
shallow=self.data.ref is None,
environment=environment,
logger=self._logger,
)
elif self.data.url_content_type == "archive":
Expand Down
8 changes: 3 additions & 5 deletions tmt/utils/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
CommandOutput,
Common,
Environment,
EnvVarValue,
GeneralError,
GitUrlError,
MetadataError,
Expand Down Expand Up @@ -737,7 +738,6 @@ def git_clone(
destination: Path,
shallow: bool = False,
can_change: bool = True,
environment: Optional[Environment] = None,
attempts: Optional[int] = None,
interval: Optional[int] = None,
timeout: Optional[int] = None,
Expand All @@ -753,17 +753,15 @@ def git_clone(
the whole history.
:param can_change: URL can be modified with hardcoded rules. Use
``can_change=False`` to disable rewrite rules.
:param environment: if set, expose these environment variables
to the ``git clone`` command. If not set, environment of the
tmt process is used.
:param attempts: Number of tries to call the function.
:param interval: Amount of seconds to wait before a new try.
:param timeout: Overall maximum time in seconds to clone the repo.
:param logger: A Logger instance to be used for logging.
:returns: Command output, bundled in a :py:class:`CommandOutput` tuple.
"""

environment = environment if environment is not None else Environment.from_environ()
environment = Environment.from_environ()
environment["GIT_ASKPASS"] = EnvVarValue("echo")

def clone_the_repo(
url: str,
Expand Down
Loading