mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-11 18:41:11 +01:00
fix: replace deprecated git lfs clone with git clone + git lfs fetch --all
git lfs clone is deprecated - modern git clone handles LFS automatically. Using git lfs fetch --all ensures all LFS objects across all refs are backed up, matching the existing bare clone behavior and providing complete LFS backups. Closes #379
This commit is contained in:
@@ -215,6 +215,8 @@ When you use the ``--lfs`` option, you will need to make sure you have Git LFS i
|
|||||||
|
|
||||||
Instructions on how to do this can be found on https://git-lfs.github.com.
|
Instructions on how to do this can be found on https://git-lfs.github.com.
|
||||||
|
|
||||||
|
LFS objects are fetched for all refs, not just the current checkout, ensuring a complete backup of all LFS content across all branches and history.
|
||||||
|
|
||||||
|
|
||||||
About Attachments
|
About Attachments
|
||||||
-----------------
|
-----------------
|
||||||
|
|||||||
@@ -2089,12 +2089,14 @@ def fetch_repository(
|
|||||||
if no_prune:
|
if no_prune:
|
||||||
git_command.pop()
|
git_command.pop()
|
||||||
logging_subprocess(git_command, cwd=local_dir)
|
logging_subprocess(git_command, cwd=local_dir)
|
||||||
else:
|
|
||||||
if lfs_clone:
|
|
||||||
git_command = ["git", "lfs", "clone", remote_url, local_dir]
|
|
||||||
else:
|
else:
|
||||||
git_command = ["git", "clone", remote_url, local_dir]
|
git_command = ["git", "clone", remote_url, local_dir]
|
||||||
logging_subprocess(git_command)
|
logging_subprocess(git_command)
|
||||||
|
if lfs_clone:
|
||||||
|
git_command = ["git", "lfs", "fetch", "--all", "--prune"]
|
||||||
|
if no_prune:
|
||||||
|
git_command.pop()
|
||||||
|
logging_subprocess(git_command, cwd=local_dir)
|
||||||
|
|
||||||
|
|
||||||
def backup_account(args, output_directory):
|
def backup_account(args, output_directory):
|
||||||
|
|||||||
Reference in New Issue
Block a user