Git - Deprecate the refs property (#172772)

This commit is contained in:
Ladislau Szomoru
2023-01-30 20:33:37 +01:00
committed by GitHub
parent 67e936ac69
commit 475c59b638
2 changed files with 6 additions and 14 deletions

View File

@@ -32,7 +32,10 @@ export class ApiChange implements Change {
export class ApiRepositoryState implements RepositoryState {
get HEAD(): Branch | undefined { return this._repository.HEAD; }
get refs(): Ref[] { return [...this._repository.refs]; }
/**
* @deprecated Use ApiRepository.getRefs() instead.
*/
get refs(): Ref[] { console.warn('Deprecated. Use ApiRepository.getRefs() instead.'); return []; }
get remotes(): Remote[] { return [...this._repository.remotes]; }
get submodules(): Submodule[] { return [...this._repository.submodules]; }
get rebaseCommit(): Commit | undefined { return this._repository.rebaseCommit; }

View File

@@ -651,11 +651,6 @@ export class Repository implements Disposable {
return this._HEAD;
}
private _refs: Ref[] = [];
get refs(): Ref[] {
return this._refs;
}
get headShortName(): string | undefined {
if (!this.HEAD) {
return;
@@ -726,7 +721,6 @@ export class Repository implements Disposable {
this._onDidChangeState.fire(state);
this._HEAD = undefined;
this._refs = [];
this._remotes = [];
this.mergeGroup.resourceStates = [];
this.indexGroup.resourceStates = [];
@@ -2005,13 +1999,8 @@ export class Repository implements Disposable {
this._sourceControl.commitTemplate = commitTemplate;
// Execute cancellable long-running operations
const [resourceGroups, refs] =
await Promise.all([
this.getStatus(cancellationToken),
this.getRefs({}, cancellationToken)]);
this._refs = refs!;
// Execute cancellable long-running operation
const resourceGroups = await this.getStatus(cancellationToken);
this._updateResourceGroupsState(resourceGroups);
this._onDidChangeStatus.fire();