mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
SCM - cleanup SourceControlHistoryProvider api (#227376)
* Remove provideHistoryItemSummary * Remove resolveHistoryItemGroupCommonAncestor * Remove provideHistoryItems * Rename methods and remove unused code * Remove duplicated code
This commit is contained in:
@@ -1508,16 +1508,13 @@ export class Repository implements Disposable {
|
||||
|
||||
private async getDefaultBranch(): Promise<Branch | undefined> {
|
||||
try {
|
||||
const defaultBranchResult = await this.repository.exec(['symbolic-ref', '--short', 'refs/remotes/origin/HEAD']);
|
||||
if (defaultBranchResult.stdout.trim() === '' || defaultBranchResult.stderr) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return this.getBranch(defaultBranchResult.stdout.trim());
|
||||
const defaultBranch = await this.repository.getDefaultBranch();
|
||||
return defaultBranch;
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.warn(`[Repository][getDefaultBranch] Failed to get default branch details: ${err.message}.`);
|
||||
return undefined;
|
||||
}
|
||||
catch (err) { }
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private async getUpstreamBranch(branch: Branch): Promise<Branch | undefined> {
|
||||
@@ -1618,14 +1615,6 @@ export class Repository implements Disposable {
|
||||
return this._EMPTY_TREE;
|
||||
}
|
||||
|
||||
async getCommitCount(range: string): Promise<{ ahead: number; behind: number }> {
|
||||
return await this.run(Operation.RevList, () => this.repository.getCommitCount(range));
|
||||
}
|
||||
|
||||
async revParse(ref: string): Promise<string | undefined> {
|
||||
return await this.run(Operation.RevParse, () => this.repository.revParse(ref));
|
||||
}
|
||||
|
||||
async reset(treeish: string, hard?: boolean): Promise<void> {
|
||||
await this.run(Operation.Reset, () => this.repository.reset(treeish, hard));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user