Compare commits

...

3 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
8a00bb1903 Release version 0.34.0 2020-07-24 13:31:03 -04:00
Jose Diaz-Gonzalez
e53f8d4724 Merge pull request #153 from 0x6d617474/gist_ssh
Add logic for transforming gist repository urls to ssh
2020-07-24 13:30:40 -04:00
Matt Fields
356f5f674b Add logic for transforming gist repository urls to ssh 2020-07-07 17:54:16 -04:00
3 changed files with 14 additions and 3 deletions

View File

@@ -1,8 +1,13 @@
Changelog Changelog
========= =========
0.33.1 (2020-05-28) 0.34.0 (2020-07-24)
------------------- -------------------
------------------------
- Add logic for transforming gist repository urls to ssh. [Matt Fields]
0.33.0 (2020-04-13)
------------------- -------------------
- Add basic API request throttling. [Enrico Tröger] - Add basic API request throttling. [Enrico Tröger]

View File

@@ -1 +1 @@
__version__ = '0.33.1' __version__ = '0.34.0'

View File

@@ -419,7 +419,13 @@ def get_github_host(args):
def get_github_repo_url(args, repository): def get_github_repo_url(args, repository):
if repository.get('is_gist'): if repository.get('is_gist'):
return repository['git_pull_url'] if args.prefer_ssh:
# The git_pull_url value is always https for gists, so we need to transform it to ssh form
repo_url = re.sub('^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url'])
repo_url = re.sub('^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility
else:
repo_url = repository['git_pull_url']
return repo_url
if args.prefer_ssh: if args.prefer_ssh:
return repository['ssh_url'] return repository['ssh_url']