Skip to content

Commit 12d2601

Browse files
committed
status bar now shows current branch
1 parent 129a994 commit 12d2601

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/repository.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export class Repository {
2222
public changes: SourceControlResourceGroup;
2323
public notTracked: SourceControlResourceGroup;
2424
private disposables: Disposable[] = [];
25+
public branch = "";
2526

2627
private _onDidChangeStatus = new EventEmitter<void>();
2728
readonly onDidChangeStatus: Event<void> = this._onDidChangeStatus.event;
@@ -128,6 +129,8 @@ export class Repository {
128129
this.changes.resourceStates = changes;
129130
this.notTracked.resourceStates = notTracked;
130131

132+
this.branch = await this.getCurrentBranch();
133+
131134
this._onDidChangeStatus.fire();
132135

133136
return Promise.resolve();
@@ -155,4 +158,8 @@ export class Repository {
155158
dispose(): void {
156159
this.disposables = dispose(this.disposables);
157160
}
161+
162+
getCurrentBranch() {
163+
return this.repository.getCurrentBranch();
164+
}
158165
}

src/statusBar.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ export class SvnStatusBar {
1818
}
1919

2020
get commands() {
21-
// const title = `$(git-branch) ${this.repository.headLabel}`;
21+
const title = `$(git-branch) ${this.repository.branch}`;
2222

2323
return [
2424
{
25-
command: "svn.refresh",
26-
tooltip: "TEST",
27-
title: "TEST",
28-
arguments: [this]
25+
command: "svn.checkout",
26+
tooltip: "Checkout...",
27+
title,
28+
arguments: [this.repository]
2929
}
3030
];
3131
}

0 commit comments

Comments
 (0)