Skip to content

Commit 7ad3242

Browse files
authored
Merge pull request #191 from SkySoft-ATM/bug/lfs_mirror
git lfs clone does not respect --mirror
2 parents 9e1800f + 885e94a commit 7ad3242

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

github_backup/github_backup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,16 +1106,17 @@ def fetch_repository(name,
11061106
masked_remote_url,
11071107
local_dir))
11081108
if bare_clone:
1109+
git_command = ['git', 'clone', '--mirror', remote_url, local_dir]
1110+
logging_subprocess(git_command, None)
11091111
if lfs_clone:
1110-
git_command = ['git', 'lfs', 'clone', '--mirror', remote_url, local_dir]
1111-
else:
1112-
git_command = ['git', 'clone', '--mirror', remote_url, local_dir]
1112+
git_command = ['git', 'lfs', 'fetch', '--all', '--prune']
1113+
logging_subprocess(git_command, None, cwd=local_dir)
11131114
else:
11141115
if lfs_clone:
11151116
git_command = ['git', 'lfs', 'clone', remote_url, local_dir]
11161117
else:
11171118
git_command = ['git', 'clone', remote_url, local_dir]
1118-
logging_subprocess(git_command, None)
1119+
logging_subprocess(git_command, None)
11191120

11201121

11211122
def backup_account(args, output_directory):

0 commit comments

Comments
 (0)