Skip to content

Commit ea0b085

Browse files
authored
filter out worktrees from getRepoId() (#3274)
1 parent 5322009 commit ea0b085

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/extension/chatSessions/vscode/copilotCodingAgentUtils.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ export async function getRepoId(gitService: IGitService): Promise<GithubRepoId[]
7676

7777
// support multi-root
7878
if (gitService.repositories.length > 1) {
79-
return gitService.repositories.map(repo => {
80-
if (repo.remoteFetchUrls && repo.remoteFetchUrls[0]) {
81-
return getGithubRepoIdFromFetchUrl(repo.remoteFetchUrls[0]);
82-
}
83-
}).filter((id): id is GithubRepoId => !!id);
79+
return gitService.repositories
80+
.filter(repo => repo.kind !== 'worktree')
81+
.map(repo => {
82+
if (repo.remoteFetchUrls && repo.remoteFetchUrls[0]) {
83+
return getGithubRepoIdFromFetchUrl(repo.remoteFetchUrls[0]);
84+
}
85+
}).filter((id): id is GithubRepoId => !!id);
8486
}
8587

8688
const repo = gitService.activeRepository.get();

0 commit comments

Comments
 (0)