mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2026-01-25 14:43:09 +01:00
fix: --all-starred now clones repos without --repositories
This commit is contained in:
@@ -561,7 +561,7 @@ def get_github_host(args):
|
||||
|
||||
|
||||
def read_file_contents(file_uri):
|
||||
return open(file_uri[len(FILE_URI_PREFIX) :], "rt").readline().strip()
|
||||
return open(file_uri[len(FILE_URI_PREFIX):], "rt").readline().strip()
|
||||
|
||||
|
||||
def get_github_repo_url(args, repository):
|
||||
@@ -1672,9 +1672,10 @@ def backup_repositories(args, output_directory, repositories):
|
||||
repo_url = get_github_repo_url(args, repository)
|
||||
|
||||
include_gists = args.include_gists or args.include_starred_gists
|
||||
include_starred = args.all_starred and repository.get("is_starred")
|
||||
if (args.include_repository or args.include_everything) or (
|
||||
include_gists and repository.get("is_gist")
|
||||
):
|
||||
) or include_starred:
|
||||
repo_name = (
|
||||
repository.get("name")
|
||||
if not repository.get("is_gist")
|
||||
@@ -2023,12 +2024,9 @@ def fetch_repository(
|
||||
):
|
||||
if bare_clone:
|
||||
if os.path.exists(local_dir):
|
||||
clone_exists = (
|
||||
subprocess.check_output(
|
||||
["git", "rev-parse", "--is-bare-repository"], cwd=local_dir
|
||||
)
|
||||
== b"true\n"
|
||||
)
|
||||
clone_exists = subprocess.check_output(
|
||||
["git", "rev-parse", "--is-bare-repository"], cwd=local_dir
|
||||
) == b"true\n"
|
||||
else:
|
||||
clone_exists = False
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user