Skip to content

Commit f62c4ea

Browse files
committed
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.
1 parent a53d7f6 commit f62c4ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

github_backup/github_backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def get_github_repo_url(args, repository):
420420
return repository['ssh_url']
421421

422422
auth = get_auth(args, encode=False, for_git_cli=True)
423-
if auth and repository['private'] is True:
423+
if auth:
424424
repo_url = 'https://{0}@{1}/{2}/{3}.git'.format(
425425
auth,
426426
get_github_host(args),

0 commit comments

Comments
 (0)