Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ android_analysis = [
"android_inspector==0.0.1"
]
mining = [
"minecode_pipelines==0.0.1b9"
"minecode_pipelines==0.0.1b11"
]

[project.urls]
Expand Down
8 changes: 6 additions & 2 deletions scanpipe/pipes/federatedcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,19 @@ def check_federatedcode_configured_and_available(logger=None):
logger("Federatedcode repositories are configured and available.")


def clone_repository(repo_url, logger=None):
def clone_repository(repo_url, shallow_clone=True, logger=None):
"""Clone repository to local_path."""
local_dir = tempfile.mkdtemp()

authenticated_repo_url = repo_url.replace(
"https://",
f"https://{settings.FEDERATEDCODE_GIT_SERVICE_TOKEN}@",
)
repo = Repo.clone_from(url=authenticated_repo_url, to_path=local_dir, depth=1)

if shallow_clone:
repo = Repo.clone_from(url=authenticated_repo_url, to_path=local_dir, depth=1)
else:
repo = Repo.clone_from(url=authenticated_repo_url, to_path=local_dir)

repo.config_writer(config_level="repository").set_value(
"user", "name", settings.FEDERATEDCODE_GIT_SERVICE_NAME
Expand Down