Fixes codespaces fork on push

Codespaces might not have a push url on the remote, so use the fetch url
This commit is contained in:
Eric Amodio 2021-03-24 17:11:17 -04:00
parent d765f3a43c
commit 38160c823c

View file

@ -161,12 +161,13 @@ export class GithubPushErrorHandler implements PushErrorHandler {
return false;
}
if (!remote.pushUrl) {
const remoteUrl = remote.pushUrl || (isInCodespaces() ? remote.fetchUrl : undefined);
if (!remoteUrl) {
return false;
}
const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\.git/i.exec(remote.pushUrl)
|| /^git@github\.com:([^/]+)\/([^/]+)\.git/i.exec(remote.pushUrl);
const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\.git/i.exec(remoteUrl)
|| /^git@github\.com:([^/]+)\/([^/]+)\.git/i.exec(remoteUrl);
if (!match) {
return false;