Skip to content
Open
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
4 changes: 3 additions & 1 deletion cadetrdm/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,9 @@ def copy_data_to_cache(self, branch_name=None, target_folder=None):
# Ensure that the branch is available locally. If it's only a remote branch, git.archive will fail.
local_branches = [head.name for head in self.output_repo._git_repo.heads]
if branch_name not in local_branches:
self.output_repo.checkout(branch_name)
self.output_repo._git_repo.create_head(
branch_name, f"origin/{branch_name}"
)

# Create the target folder if it doesn't exist
if not target_folder.exists():
Expand Down