From 8203e93ca5a00486e5ed74b4d4a7662c61942d37 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Mon, 5 Jan 2026 14:57:00 +0100 Subject: [PATCH] Fix git sync failing to clone (cherry picked from commit bca0bac3cbb6dd6e06c0955476b4a1dcda5c97b4) --- CHANGES/+git_sync_clone.bugfix | 1 + pulp_ansible/app/tasks/collections.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 CHANGES/+git_sync_clone.bugfix diff --git a/CHANGES/+git_sync_clone.bugfix b/CHANGES/+git_sync_clone.bugfix new file mode 100644 index 000000000..ff157c37a --- /dev/null +++ b/CHANGES/+git_sync_clone.bugfix @@ -0,0 +1 @@ +Fixed a bug that made synching git repositories fail on clone. diff --git a/pulp_ansible/app/tasks/collections.py b/pulp_ansible/app/tasks/collections.py index 5bbb4b851..a78bd6be1 100644 --- a/pulp_ansible/app/tasks/collections.py +++ b/pulp_ansible/app/tasks/collections.py @@ -90,13 +90,15 @@ async def declarative_content_from_git_repo(remote, url, git_ref=None, metadata_ if git_ref: try: gitrepo = Repo.clone_from( - url, uuid4(), depth=1, branch=git_ref, multi_options=["--recurse-submodules"] + url, str(uuid4()), depth=1, branch=git_ref, multi_options=["--recurse-submodules"] ) except GitCommandError: - gitrepo = Repo.clone_from(url, uuid4(), multi_options=["--recurse-submodules"]) + gitrepo = Repo.clone_from(url, str(uuid4()), multi_options=["--recurse-submodules"]) gitrepo.git.checkout(git_ref) else: - gitrepo = Repo.clone_from(url, uuid4(), depth=1, multi_options=["--recurse-submodules"]) + gitrepo = Repo.clone_from( + url, str(uuid4()), depth=1, multi_options=["--recurse-submodules"] + ) commit_sha = gitrepo.head.commit.hexsha metadata, artifact_path = sync_collection(gitrepo.working_dir, ".") if not metadata_only: