From f62c4eaf8b8b6da35974f75adc9480d03eb80305 Mon Sep 17 00:00:00 2001 From: Samantha Baldwin Date: Fri, 12 Feb 2021 00:46:06 -0500 Subject: [PATCH] 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. --- github_backup/github_backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_backup/github_backup.py b/github_backup/github_backup.py index dc69e68..762e583 100644 --- a/github_backup/github_backup.py +++ b/github_backup/github_backup.py @@ -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),