Skip to content

Commit 8fcc142

Browse files
authored
Merge pull request #465 from Iamrodos/fix/379-lfs-clone-deprecated
fix: replace deprecated git lfs clone with git clone + git lfs fetch --all
2 parents 7615ce6 + e745b55 commit 8fcc142

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ When you use the ``--lfs`` option, you will need to make sure you have Git LFS i
215215

216216
Instructions on how to do this can be found on https://git-lfs.github.com.
217217

218+
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.
219+
218220

219221
About Attachments
220222
-----------------

github_backup/github_backup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,11 +2090,13 @@ def fetch_repository(
20902090
git_command.pop()
20912091
logging_subprocess(git_command, cwd=local_dir)
20922092
else:
2093-
if lfs_clone:
2094-
git_command = ["git", "lfs", "clone", remote_url, local_dir]
2095-
else:
2096-
git_command = ["git", "clone", remote_url, local_dir]
2093+
git_command = ["git", "clone", remote_url, local_dir]
20972094
logging_subprocess(git_command)
2095+
if lfs_clone:
2096+
git_command = ["git", "lfs", "fetch", "--all", "--prune"]
2097+
if no_prune:
2098+
git_command.pop()
2099+
logging_subprocess(git_command, cwd=local_dir)
20982100

20992101

21002102
def backup_account(args, output_directory):

0 commit comments

Comments
 (0)