Browse Source

Fixes remote branches showing decorations

main
Eric Amodio 3 years ago
parent
commit
d43c03494b
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/git/models/branch.ts

+ 5
- 2
src/git/models/branch.ts View File

@ -29,9 +29,10 @@ export enum GitBranchStatus {
Ahead = 'ahead',
Behind = 'behind',
Diverged = 'diverged',
Local = 'local',
Remote = 'remote',
UpToDate = 'upToDate',
Unpublished = 'unpublished',
LocalOnly = 'localOnly',
}
export class GitBranch implements GitBranchReference {
@ -200,6 +201,8 @@ export class GitBranch implements GitBranchReference {
@memoize()
async getStatus(): Promise<GitBranchStatus> {
if (this.remote) return GitBranchStatus.Remote;
if (this.tracking) {
if (this.state.ahead && this.state.behind) return GitBranchStatus.Diverged;
if (this.state.ahead) return GitBranchStatus.Ahead;
@ -210,7 +213,7 @@ export class GitBranch implements GitBranchReference {
const remotes = await Container.git.getRemotes(this.repoPath);
if (remotes.length > 0) return GitBranchStatus.Unpublished;
return GitBranchStatus.LocalOnly;
return GitBranchStatus.Local;
}
getTrackingStatus(options?: {

Loading…
Cancel
Save