Skip to content

Commit

Permalink
oauth: gitlab: use SSH url if repo is private
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitKnecht committed Jun 20, 2016
1 parent f9df35e commit e4adb98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion readthedocs/oauth/services/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ def is_owned_by(owner_id):
repo.ssh_url = fields['ssh_url_to_repo']
repo.html_url = fields['web_url']
repo.private = not fields['public']
repo.clone_url = fields['http_url_to_repo']
repo.admin = not repo_is_public
repo.clone_url = (repo.admin and repo.ssh_url or
fields['http_url_to_repo'])
if not repo.admin and 'owner' in fields:
repo.admin = is_owned_by(fields['owner']['id'])
repo.vcs = 'git'
Expand Down

0 comments on commit e4adb98

Please sign in to comment.