Fix remote repository connection checking
Created by: chrismwendt
Previously, the frontend would neglect to check that the repository is associated with a GitHub external service in addition to checking that the repository hostname is github.com
before finding an access token and looking up the repository on GitHub.com via HTTPS.
This adds a check to make sure the repository is associated with the external service before using the token from the external service.
- @nicksnyder Does this look like an appropriate change to make? You probably have a better understanding of the data model and relationships between repositories, URLs, access tokens, and external services than I do.
- @slimsag Does this actually fix the problem you saw in the issue below?
Fixes https://github.com/sourcegraph/sourcegraph/issues/1856