mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
fix: Always clone with OAuth token when provided
Github Enterprise servers with 'Anonymous Git read access' disabled cause `git ls-remote` to fail (128) for a repo's `clone_url`. Using the OAuth token when provided allows cloning private AND public repos when Anonymous Git read access is disabled.
This commit is contained in:
@@ -420,7 +420,7 @@ def get_github_repo_url(args, repository):
|
||||
return repository['ssh_url']
|
||||
|
||||
auth = get_auth(args, encode=False, for_git_cli=True)
|
||||
if auth and repository['private'] is True:
|
||||
if auth:
|
||||
repo_url = 'https://{0}@{1}/{2}/{3}.git'.format(
|
||||
auth,
|
||||
get_github_host(args),
|
||||
|
||||
Reference in New Issue
Block a user