Skip to content

Commit 372fcc9

Browse files
mdellwegggainey
authored andcommitted
Fix git sync failing to clone
(cherry picked from commit bca0bac)
1 parent d3bbfbb commit 372fcc9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGES/+git_sync_clone.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a bug that made synching git repositories fail on clone.

pulp_ansible/app/tasks/collections.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,15 @@ async def declarative_content_from_git_repo(remote, url, git_ref=None, metadata_
126126
if git_ref:
127127
try:
128128
gitrepo = Repo.clone_from(
129-
url, uuid4(), depth=1, branch=git_ref, multi_options=["--recurse-submodules"]
129+
url, str(uuid4()), depth=1, branch=git_ref, multi_options=["--recurse-submodules"]
130130
)
131131
except GitCommandError:
132-
gitrepo = Repo.clone_from(url, uuid4(), multi_options=["--recurse-submodules"])
132+
gitrepo = Repo.clone_from(url, str(uuid4()), multi_options=["--recurse-submodules"])
133133
gitrepo.git.checkout(git_ref)
134134
else:
135-
gitrepo = Repo.clone_from(url, uuid4(), depth=1, multi_options=["--recurse-submodules"])
135+
gitrepo = Repo.clone_from(
136+
url, str(uuid4()), depth=1, multi_options=["--recurse-submodules"]
137+
)
136138
commit_sha = gitrepo.head.commit.hexsha
137139
metadata, artifact_path = sync_collection(gitrepo.working_dir, ".")
138140
artifact = Artifact.init_and_validate(artifact_path)

0 commit comments

Comments
 (0)