提交 a01de650 编写于 作者: J Joao Moreno

scm: ignore uniqueness of `SourceControl.id`

上级 f0c93eb9
......@@ -269,8 +269,6 @@ export interface GitResourceGroup extends SourceControlResourceGroup {
export class Repository implements Disposable {
private static handle = 0;
private _onDidChangeRepository = new EventEmitter<Uri>();
readonly onDidChangeRepository: Event<Uri> = this._onDidChangeRepository.event;
......@@ -360,10 +358,9 @@ export class Repository implements Disposable {
const onRelevantGitChange = filterEvent(onGitChange, uri => !/\/\.git\/index\.lock$/.test(uri.path));
onRelevantGitChange(this._onDidChangeRepository.fire, this._onDidChangeRepository, this.disposables);
const id = `git${Repository.handle++}`;
const label = `Git - ${path.basename(repository.root)}`;
this._sourceControl = scm.createSourceControl(id, label);
this._sourceControl = scm.createSourceControl('git', label);
this._sourceControl.acceptInputCommand = { command: 'git.commitWithInput', title: localize('commit', "Commit") };
this._sourceControl.quickDiffProvider = this;
this.disposables.push(this._sourceControl);
......
......@@ -5448,7 +5448,7 @@ declare module 'vscode' {
/**
* Creates a new [source control](#SourceControl) instance.
*
* @param id A unique `id` for the source control. Something short, eg: `git`.
* @param id An `id` for the source control. Something short, eg: `git`.
* @param label A human-readable string for the source control. Eg: `Git`.
* @return An instance of [source control](#SourceControl).
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册