mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f9cf7ff89 | ||
|
|
899ab5fdc2 |
@@ -301,6 +301,8 @@ Starred gists vs starred repo behaviour
|
|||||||
|
|
||||||
The starred normal repo cloning (``--all-starred``) argument stores starred repos separately to the users own repositories. However, using ``--starred-gists`` will store starred gists within the same directory as the users own gists ``--gists``. Also, all gist repo directory names are IDs not the gist's name.
|
The starred normal repo cloning (``--all-starred``) argument stores starred repos separately to the users own repositories. However, using ``--starred-gists`` will store starred gists within the same directory as the users own gists ``--gists``. Also, all gist repo directory names are IDs not the gist's name.
|
||||||
|
|
||||||
|
Note: ``--starred-gists`` only retrieves starred gists for the authenticated user, not the target user, due to a GitHub API limitation.
|
||||||
|
|
||||||
|
|
||||||
Skip existing on incomplete backups
|
Skip existing on incomplete backups
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|||||||
@@ -1565,16 +1565,22 @@ def retrieve_repositories(args, authenticated_user):
|
|||||||
repos.extend(gists)
|
repos.extend(gists)
|
||||||
|
|
||||||
if args.include_starred_gists:
|
if args.include_starred_gists:
|
||||||
starred_gists_template = "https://{0}/gists/starred".format(
|
if not authenticated_user.get("login") or args.user.lower() != authenticated_user["login"].lower():
|
||||||
get_github_api_host(args)
|
logger.warning(
|
||||||
)
|
"Cannot retrieve starred gists for '%s'. GitHub only allows access to the authenticated user's starred gists.",
|
||||||
starred_gists = retrieve_data(
|
args.user,
|
||||||
args, starred_gists_template, single_request=False
|
)
|
||||||
)
|
else:
|
||||||
# flag each repo as a starred gist for downstream processing
|
starred_gists_template = "https://{0}/gists/starred".format(
|
||||||
for item in starred_gists:
|
get_github_api_host(args)
|
||||||
item.update({"is_gist": True, "is_starred": True})
|
)
|
||||||
repos.extend(starred_gists)
|
starred_gists = retrieve_data(
|
||||||
|
args, starred_gists_template, single_request=False
|
||||||
|
)
|
||||||
|
# flag each repo as a starred gist for downstream processing
|
||||||
|
for item in starred_gists:
|
||||||
|
item.update({"is_gist": True, "is_starred": True})
|
||||||
|
repos.extend(starred_gists)
|
||||||
|
|
||||||
return repos
|
return repos
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user