3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { Disposable , Event , ProviderResult , Uri , Command } from 'vscode' ;
6
+ import { Command , CancellationToken , Disposable , Event , ProviderResult , Uri } from 'vscode' ;
7
7
import { GitErrorCodes , RefType , Status , ForcePushMode } from '../@types/vscode.git.enums' ;
8
8
9
9
export interface Git {
@@ -24,6 +24,7 @@ export interface Ref {
24
24
export interface UpstreamRef {
25
25
readonly remote : string ;
26
26
readonly name : string ;
27
+ readonly commit ?: string ;
27
28
}
28
29
29
30
export interface Branch extends Ref {
@@ -32,6 +33,12 @@ export interface Branch extends Ref {
32
33
readonly behind ?: number ;
33
34
}
34
35
36
+ export interface CommitShortStat {
37
+ readonly files : number ;
38
+ readonly insertions : number ;
39
+ readonly deletions : number ;
40
+ }
41
+
35
42
export interface Commit {
36
43
readonly hash : string ;
37
44
readonly message : string ;
@@ -40,6 +47,7 @@ export interface Commit {
40
47
readonly authorName ?: string ;
41
48
readonly authorEmail ?: string ;
42
49
readonly commitDate ?: Date ;
50
+ readonly shortStat ?: CommitShortStat ;
43
51
}
44
52
45
53
export interface Submodule {
@@ -77,6 +85,7 @@ export interface RepositoryState {
77
85
readonly mergeChanges : Change [ ] ;
78
86
readonly indexChanges : Change [ ] ;
79
87
readonly workingTreeChanges : Change [ ] ;
88
+ readonly untrackedChanges : Change [ ] ;
80
89
81
90
readonly onDidChange : Event < void > ;
82
91
}
@@ -97,6 +106,11 @@ export interface LogOptions {
97
106
readonly range ?: string ;
98
107
readonly reverse ?: boolean ;
99
108
readonly sortByAuthorDate ?: boolean ;
109
+ readonly shortStats ?: boolean ;
110
+ readonly author ?: string ;
111
+ readonly refNames ?: string [ ] ;
112
+ readonly maxParents ?: number ;
113
+ readonly skip ?: number ;
100
114
}
101
115
102
116
export interface CommitOptions {
@@ -147,6 +161,8 @@ export interface Repository {
147
161
readonly state : RepositoryState ;
148
162
readonly ui : RepositoryUIState ;
149
163
164
+ readonly onDidCommit : Event < void > ;
165
+
150
166
getConfigs ( ) : Promise < { key : string ; value : string } [ ] > ;
151
167
getConfig ( key : string ) : Promise < string > ;
152
168
setConfig ( key : string , value : string ) : Promise < string > ;
@@ -185,9 +201,11 @@ export interface Repository {
185
201
getBranchBase ( name : string ) : Promise < Branch | undefined > ;
186
202
setBranchUpstream ( name : string , upstream : string ) : Promise < void > ;
187
203
204
+ checkIgnore ( paths : string [ ] ) : Promise < Set < string > > ;
205
+
188
206
getRefs ( query : RefQuery , cancellationToken ?: CancellationToken ) : Promise < Ref [ ] > ;
189
207
190
- getMergeBase ( ref1 : string , ref2 : string ) : Promise < string > ;
208
+ getMergeBase ( ref1 : string , ref2 : string ) : Promise < string | undefined > ;
191
209
192
210
tag ( name : string , upstream : string ) : Promise < void > ;
193
211
deleteTag ( name : string ) : Promise < void > ;
@@ -208,6 +226,8 @@ export interface Repository {
208
226
log ( options ?: LogOptions ) : Promise < Commit [ ] > ;
209
227
210
228
commit ( message : string , opts ?: CommitOptions ) : Promise < void > ;
229
+ merge ( ref : string ) : Promise < void > ;
230
+ mergeAbort ( ) : Promise < void > ;
211
231
}
212
232
213
233
export interface RemoteSource {
@@ -268,16 +288,6 @@ export interface BranchProtectionProvider {
268
288
provideBranchProtection ( ) : BranchProtection [ ] ;
269
289
}
270
290
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
-
281
291
export type APIState = 'uninitialized' | 'initialized' ;
282
292
283
293
export interface PublishEvent {
@@ -305,7 +315,6 @@ export interface API {
305
315
registerPostCommitCommandsProvider ( provider : PostCommitCommandsProvider ) : Disposable ;
306
316
registerPushErrorHandler ( handler : PushErrorHandler ) : Disposable ;
307
317
registerBranchProtectionProvider ( root : Uri , provider : BranchProtectionProvider ) : Disposable ;
308
- registerCommitMessageProvider ( provider : CommitMessageProvider ) : Disposable ;
309
318
}
310
319
311
320
export interface GitExtension {
0 commit comments