From 04c70ce277565bdb1c2c0732ff5d29756b94e995 Mon Sep 17 00:00:00 2001 From: Louis Parisot Date: Tue, 10 Sep 2024 11:00:17 +0200 Subject: [PATCH] git fetch is required even when using lfs --- github_backup/github_backup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/github_backup/github_backup.py b/github_backup/github_backup.py index 299a3a1..b7b8916 100644 --- a/github_backup/github_backup.py +++ b/github_backup/github_backup.py @@ -1318,13 +1318,15 @@ def fetch_repository( git_command = ["git", "remote", "set-url", "origin", remote_url] logging_subprocess(git_command, cwd=local_dir) - if lfs_clone: - git_command = ["git", "lfs", "fetch", "--all", "--prune"] - else: - git_command = ["git", "fetch", "--all", "--force", "--tags", "--prune"] + git_command = ["git", "fetch", "--all", "--force", "--tags", "--prune"] if no_prune: git_command.pop() logging_subprocess(git_command, cwd=local_dir) + if lfs_clone: + git_command = ["git", "lfs", "fetch", "--all", "--prune"] + if no_prune: + git_command.pop() + logging_subprocess(git_command, cwd=local_dir) else: logger.info( "Cloning {0} repository from {1} to {2}".format(