Skip to content

Commit 4a2de90

Browse files
authored
NewIssue.md template doesn't autocomplete Assignees anymore (#6729)
Fixes #6709
1 parent a785cd9 commit 4a2de90

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/github/repositoriesManager.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Disposable, disposeAll } from '../common/lifecycle';
1111
import Logger from '../common/logger';
1212
import { ITelemetry } from '../common/telemetry';
1313
import { EventType } from '../common/timelineEvent';
14+
import { fromRepoUri, Schemes } from '../common/uri';
1415
import { compareIgnoreCase, isDescendant } from '../common/utils';
1516
import { CredentialStore } from './credentials';
1617
import { FolderRepositoryManager, ReposManagerState, ReposManagerStateContext } from './folderRepositoryManager';
@@ -132,18 +133,25 @@ export class RepositoriesManager extends Disposable {
132133
return this._folderManagers[0];
133134
}
134135

136+
const repoInfo = ((uri.scheme === Schemes.Repo) ? fromRepoUri(uri) : undefined);
137+
135138
// Prioritize longest path first to handle nested workspaces
136139
const folderManagers = this._folderManagers
137140
.slice()
138141
.sort((a, b) => b.repository.rootUri.path.length - a.repository.rootUri.path.length);
139142

140143
for (const folderManager of folderManagers) {
141144
const managerPath = folderManager.repository.rootUri.path;
142-
const testUriRelativePath = uri.path.substring(
143-
managerPath.length > 1 ? managerPath.length + 1 : managerPath.length,
144-
);
145-
if (compareIgnoreCase(vscode.Uri.joinPath(folderManager.repository.rootUri, testUriRelativePath).path, uri.path) === 0) {
145+
146+
if (repoInfo && folderManager.findExistingGitHubRepository({ owner: repoInfo.owner, repositoryName: repoInfo.repo })) {
146147
return folderManager;
148+
} else {
149+
const testUriRelativePath = uri.path.substring(
150+
managerPath.length > 1 ? managerPath.length + 1 : managerPath.length,
151+
);
152+
if (compareIgnoreCase(vscode.Uri.joinPath(folderManager.repository.rootUri, testUriRelativePath).path, uri.path) === 0) {
153+
return folderManager;
154+
}
147155
}
148156
}
149157
return undefined;

0 commit comments

Comments
 (0)