Skip to content

Commit 38ca802

Browse files
feat: add push to git extension API
1 parent 852cfda commit 38ca802

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

extensions/git/src/api/api1.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ export class ApiRepository implements Repository {
150150
pull(): Promise<void> {
151151
return this._repository.pull();
152152
}
153+
154+
push(head: Branch): Promise<void> {
155+
return this._repository.push(head);
156+
}
157+
158+
pushTo(remote?: string, name?: string, setUpstream: boolean = false): Promise<void> {
159+
return this._repository.pushTo(remote, name, setUpstream);
160+
}
153161
}
154162

155163
export class ApiGit implements Git {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ export interface Repository {
118118

119119
fetch(remote?: string, ref?: string): Promise<void>;
120120
pull(): Promise<void>;
121+
push(head: Branch): Promise<void>;
122+
pushTo(remote?: string, name?: string, setUpstream?: boolean): Promise<void>;
121123
}
122124

123125
export interface API {

0 commit comments

Comments
 (0)