33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import { Disposable , Event , ProviderResult , Uri , Command } from 'vscode' ;
6+ import { Command , CancellationToken , Disposable , Event , ProviderResult , Uri } from 'vscode' ;
77import { GitErrorCodes , RefType , Status , ForcePushMode } from '../@types/vscode.git.enums' ;
88
99export interface Git {
@@ -24,6 +24,7 @@ export interface Ref {
2424export interface UpstreamRef {
2525 readonly remote : string ;
2626 readonly name : string ;
27+ readonly commit ?: string ;
2728}
2829
2930export interface Branch extends Ref {
@@ -32,6 +33,12 @@ export interface Branch extends Ref {
3233 readonly behind ?: number ;
3334}
3435
36+ export interface CommitShortStat {
37+ readonly files : number ;
38+ readonly insertions : number ;
39+ readonly deletions : number ;
40+ }
41+
3542export interface Commit {
3643 readonly hash : string ;
3744 readonly message : string ;
@@ -40,6 +47,7 @@ export interface Commit {
4047 readonly authorName ?: string ;
4148 readonly authorEmail ?: string ;
4249 readonly commitDate ?: Date ;
50+ readonly shortStat ?: CommitShortStat ;
4351}
4452
4553export interface Submodule {
@@ -77,6 +85,7 @@ export interface RepositoryState {
7785 readonly mergeChanges : Change [ ] ;
7886 readonly indexChanges : Change [ ] ;
7987 readonly workingTreeChanges : Change [ ] ;
88+ readonly untrackedChanges : Change [ ] ;
8089
8190 readonly onDidChange : Event < void > ;
8291}
@@ -97,6 +106,11 @@ export interface LogOptions {
97106 readonly range ?: string ;
98107 readonly reverse ?: boolean ;
99108 readonly sortByAuthorDate ?: boolean ;
109+ readonly shortStats ?: boolean ;
110+ readonly author ?: string ;
111+ readonly refNames ?: string [ ] ;
112+ readonly maxParents ?: number ;
113+ readonly skip ?: number ;
100114}
101115
102116export interface CommitOptions {
@@ -147,6 +161,8 @@ export interface Repository {
147161 readonly state : RepositoryState ;
148162 readonly ui : RepositoryUIState ;
149163
164+ readonly onDidCommit : Event < void > ;
165+
150166 getConfigs ( ) : Promise < { key : string ; value : string } [ ] > ;
151167 getConfig ( key : string ) : Promise < string > ;
152168 setConfig ( key : string , value : string ) : Promise < string > ;
@@ -185,9 +201,11 @@ export interface Repository {
185201 getBranchBase ( name : string ) : Promise < Branch | undefined > ;
186202 setBranchUpstream ( name : string , upstream : string ) : Promise < void > ;
187203
204+ checkIgnore ( paths : string [ ] ) : Promise < Set < string > > ;
205+
188206 getRefs ( query : RefQuery , cancellationToken ?: CancellationToken ) : Promise < Ref [ ] > ;
189207
190- getMergeBase ( ref1 : string , ref2 : string ) : Promise < string > ;
208+ getMergeBase ( ref1 : string , ref2 : string ) : Promise < string | undefined > ;
191209
192210 tag ( name : string , upstream : string ) : Promise < void > ;
193211 deleteTag ( name : string ) : Promise < void > ;
@@ -208,6 +226,8 @@ export interface Repository {
208226 log ( options ?: LogOptions ) : Promise < Commit [ ] > ;
209227
210228 commit ( message : string , opts ?: CommitOptions ) : Promise < void > ;
229+ merge ( ref : string ) : Promise < void > ;
230+ mergeAbort ( ) : Promise < void > ;
211231}
212232
213233export interface RemoteSource {
@@ -268,16 +288,6 @@ export interface BranchProtectionProvider {
268288 provideBranchProtection ( ) : BranchProtection [ ] ;
269289}
270290
271- export interface CommitMessageProvider {
272- readonly title : string ;
273- readonly icon ?: Uri | { light : Uri ; dark : Uri } | ThemeIcon ;
274- provideCommitMessage (
275- repository : Repository ,
276- changes : string [ ] ,
277- cancellationToken ?: CancellationToken ,
278- ) : Promise < string | undefined > ;
279- }
280-
281291export type APIState = 'uninitialized' | 'initialized' ;
282292
283293export interface PublishEvent {
@@ -305,7 +315,6 @@ export interface API {
305315 registerPostCommitCommandsProvider ( provider : PostCommitCommandsProvider ) : Disposable ;
306316 registerPushErrorHandler ( handler : PushErrorHandler ) : Disposable ;
307317 registerBranchProtectionProvider ( root : Uri , provider : BranchProtectionProvider ) : Disposable ;
308- registerCommitMessageProvider ( provider : CommitMessageProvider ) : Disposable ;
309318}
310319
311320export interface GitExtension {
0 commit comments