Skip to content

Commit 1233e48

Browse files
authored
extension explodes and kicks back out to GITHUB: LOGIN when non github repos are in working directory (specifically codeberg) (#7834)
Fixes #6945
1 parent 42be9f0 commit 1233e48

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/authentication/githubServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { HostHelper } from './configuration';
1414
export class GitHubManager {
1515
private static readonly _githubDotComServers = new Set<string>().add('github.com').add('ssh.github.com');
1616
private static readonly _gheServers = new Set<string>().add('ghe.com');
17-
private static readonly _neverGitHubServers = new Set<string>().add('bitbucket.org').add('gitlab.com');
17+
private static readonly _neverGitHubServers = new Set<string>().add('bitbucket.org').add('gitlab.com').add('codeberg.org');
1818
private _knownServers: Map<string, GitHubServerType> = new Map([...Array.from(GitHubManager._githubDotComServers.keys()).map(key => [key, GitHubServerType.GitHubDotCom]), ...Array.from(GitHubManager._gheServers.keys()).map(key => [key, GitHubServerType.Enterprise])] as [string, GitHubServerType][]);
1919

2020
public static isGithubDotCom(host: string): boolean {

src/github/folderRepositoryManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export class FolderRepositoryManager extends Disposable {
464464
// good
465465
} else if ((enterpriseCount > 0) && this._credentialStore.isAuthenticated(AuthProvider.githubEnterprise)) {
466466
// also good
467-
} else if (isAuthenticated) {
467+
} else if (isAuthenticated && ((dotComCount > 0) || (enterpriseCount > 0))) {
468468
// Not good. We have a mismatch between auth type and server type.
469469
isAuthenticated = false;
470470
}

0 commit comments

Comments
 (0)