mirror of
https://github.com/Microsoft/vscode
synced 2024-07-05 01:08:57 +00:00
Git - adjust branch base computation (#204585)
This commit is contained in:
parent
614c5437cb
commit
0679fa72d5
|
@ -182,6 +182,13 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
|||
|
||||
private async resolveHistoryItemGroupBase(historyItemId: string): Promise<UpstreamRef | undefined> {
|
||||
try {
|
||||
// Upstream
|
||||
const branch = await this.repository.getBranch(historyItemId);
|
||||
if (branch.upstream) {
|
||||
return branch.upstream;
|
||||
}
|
||||
|
||||
// Base (config -> reflog -> default)
|
||||
const remoteBranch = await this.repository.getBranchBase(historyItemId);
|
||||
if (!remoteBranch?.remote || !remoteBranch?.name || !remoteBranch?.commit || remoteBranch?.type !== RefType.RemoteHead) {
|
||||
return undefined;
|
||||
|
|
|
@ -1484,11 +1484,6 @@ export class Repository implements Disposable {
|
|||
|
||||
async getBranchBase(ref: string): Promise<Branch | undefined> {
|
||||
const branch = await this.getBranch(ref);
|
||||
const branchUpstream = await this.getUpstreamBranch(branch);
|
||||
|
||||
if (branchUpstream) {
|
||||
return branchUpstream;
|
||||
}
|
||||
|
||||
// Git config
|
||||
const mergeBaseConfigKey = `branch.${branch.name}.vscode-merge-base`;
|
||||
|
|
Loading…
Reference in New Issue
Block a user