Skip to content

Commit

Permalink
use repo callsign to identify repo
Browse files Browse the repository at this point in the history
Summary: use repo callsign to identify repo to open file in, instead of doing the slow filesystem check.

Reviewed By: evangrayk

Differential Revision: D64576674

fbshipit-source-id: 93183ebcfe78450162052e5d27cf7803c55eeb29
  • Loading branch information
Larry Lai authored and facebook-github-bot committed Oct 18, 2024
1 parent 724e82b commit 53723e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addons/vscode/extension/VSCodeRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import SaplingFileDecorationProvider from './SaplingFileDecorationProvider';
import {executeVSCodeCommand} from './commands';
import {getCLICommand} from './config';
import {t} from './i18n';
import {existsSync} from 'fs';
import {Repository} from 'isl-server/src/Repository';
import {repositoryCache} from 'isl-server/src/RepositoryCache';
import {ResolveOperation, ResolveTool} from 'isl/src/operations/ResolveOperation';
Expand Down Expand Up @@ -116,10 +115,10 @@ export class VSCodeReposList {
return undefined;
}

public repoForRelativePath(relativePath: string): VSCodeRepo | undefined {
public repoForPhabricatorCallsign(callsign: string): VSCodeRepo | undefined {
for (const repo of this.vscodeRepos.values()) {
const fullPath = path.join(repo.rootPath, relativePath);
if (existsSync(fullPath)) {
const system = repo.repo.info.codeReviewSystem;
if (system.type === 'phabricator' && system.callsign === callsign) {
return repo;
}
}
Expand Down

0 comments on commit 53723e8

Please sign in to comment.