We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1312863 + 356f5f6 commit e53f8d4Copy full SHA for e53f8d4
github_backup/github_backup.py
@@ -419,7 +419,13 @@ def get_github_host(args):
419
420
def get_github_repo_url(args, repository):
421
if repository.get('is_gist'):
422
- return repository['git_pull_url']
+ if args.prefer_ssh:
423
+ # The git_pull_url value is always https for gists, so we need to transform it to ssh form
424
+ repo_url = re.sub('^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url'])
425
+ repo_url = re.sub('^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility
426
+ else:
427
+ repo_url = repository['git_pull_url']
428
+ return repo_url
429
430
if args.prefer_ssh:
431
return repository['ssh_url']
0 commit comments