git_deploy: specify branch in clone command

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2024-01-27 13:55:53 -05:00
parent 52ebc2b404
commit 3f7cae09bb
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 4 additions and 1 deletions

View File

@ -877,7 +877,10 @@ class GitRepo:
if self.backup_path.exists():
await event_loop.run_in_thread(shutil.rmtree, self.backup_path)
await self._check_lock_file_exists(remove=True)
cmd = f"clone --filter=blob:none {self.recovery_url} {self.backup_path}"
cmd = (
f"clone --branch {self.primary_branch} --filter=blob:none "
f"{self.recovery_url} {self.backup_path}"
)
try:
await self._run_git_cmd_async(cmd, 1, False, False)
except Exception as e: