Skip to content

Commit a9bc997

Browse files
committed
git api: remotes
1 parent 2a299bb commit a9bc997

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

extensions/git/src/api/api1.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { Model } from '../model';
99
import { Repository as BaseRepository } from '../repository';
10-
import { InputBox, Git, API, Repository } from './git';
10+
import { InputBox, Git, API, Repository, Remote } from './git';
1111
import { Event, SourceControlInputBox, Uri } from 'vscode';
1212
import { mapEvent } from '../util';
1313

@@ -21,11 +21,11 @@ export class ApiRepository implements Repository {
2121

2222
readonly rootUri: Uri = Uri.file(this._repository.root);
2323
readonly inputBox: InputBox = new ApiInputBox(this._repository.inputBox);
24+
get remotes(): Remote[] { return [...this._repository.remotes]; }
2425

2526
readonly onDidRunGitStatus: Event<void> = this._repository.onDidRunGitStatus;
2627

27-
constructor(private _repository: BaseRepository) {
28-
}
28+
constructor(private _repository: BaseRepository) { }
2929

3030
status(): Promise<void> {
3131
return this._repository.status();

extensions/git/src/api/git.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ export interface InputBox {
1414
value: string;
1515
}
1616

17+
export interface Remote {
18+
readonly name: string;
19+
readonly fetchUrl?: string;
20+
readonly pushUrl?: string;
21+
readonly isReadOnly: boolean;
22+
}
23+
1724
export interface Repository {
1825
readonly rootUri: Uri;
1926
readonly inputBox: InputBox;
27+
readonly remotes: Remote[];
2028

2129
readonly onDidRunGitStatus: Event<void>;
2230

0 commit comments

Comments
 (0)