Skip to content

Commit

Permalink
GH-4272: Got rid of the FileUri dependency from the Git frontend code.
Browse files Browse the repository at this point in the history
Used the FS instead.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
  • Loading branch information
Akos Kitta authored and kittaakos committed Feb 12, 2019
1 parent 34e35a9 commit 1955032
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/git/src/browser/git-quick-open-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { GitRepositoryProvider } from './git-repository-provider';
import { MessageService } from '@theia/core/lib/common/message-service';
import URI from '@theia/core/lib/common/uri';
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
import { FileUri } from '@theia/core/lib/node/file-uri';
import { FileSystem } from '@theia/filesystem/lib/common';
import { GitErrorHandler } from './git-error-handler';

Expand Down Expand Up @@ -273,13 +272,14 @@ export class GitQuickOpenService {
async changeRepository(): Promise<void> {
const repositories = this.repositoryProvider.allRepositories;
if (repositories.length > 1) {
const items = repositories.map(repository => {
const items = await Promise.all(repositories.map(async repository => {
const uri = new URI(repository.localUri);
const execute = () => this.repositoryProvider.selectedRepository = repository;
const toLabel = () => uri.path.base;
const toDescription = () => FileUri.fsPath(uri);
const fsPath = await this.fileSystem.getFsPath(uri.toString());
const toDescription = () => fsPath;
return new GitQuickOpenItem<Repository>(repository, execute, toLabel, toDescription);
});
}));
this.open(items, 'Select a local Git repository to work with:');
}
}
Expand Down

0 comments on commit 1955032

Please sign in to comment.