@@ -164,6 +164,39 @@ export class GitPanel extends React.Component<
164
164
this . setState ( { isHistoryVisible : ! this . state . isHistoryVisible } ) ;
165
165
} ;
166
166
167
+ /**
168
+ * Commits all marked files.
169
+ *
170
+ * @param message - commit message
171
+ * @returns a promise which commits the files
172
+ */
173
+ commitMarkedFiles = async ( message : string ) : Promise < void > => {
174
+ await this . props . model . reset ( ) ;
175
+ await this . props . model . add ( ...this . _markedFiles . map ( file => file . to ) ) ;
176
+ await this . commitStagedFiles ( message ) ;
177
+ } ;
178
+
179
+ /**
180
+ * Commits all staged files.
181
+ *
182
+ * @param message - commit message
183
+ * @returns a promise which commits the files
184
+ */
185
+ commitStagedFiles = async ( message : string ) : Promise < void > => {
186
+ try {
187
+ if (
188
+ message &&
189
+ message !== '' &&
190
+ ( await this . _hasIdentity ( this . props . model . pathRepository ) )
191
+ ) {
192
+ await this . props . model . commit ( message ) ;
193
+ }
194
+ } catch ( error ) {
195
+ console . error ( error ) ;
196
+ showErrorMessage ( 'Fail to commit' , error ) ;
197
+ }
198
+ } ;
199
+
167
200
render ( ) {
168
201
let filelist : React . ReactElement ;
169
202
let main : React . ReactElement ;
@@ -195,14 +228,14 @@ export class GitPanel extends React.Component<
195
228
msg = (
196
229
< CommitBox
197
230
hasFiles = { this . _markedFiles . length > 0 }
198
- onCommit = { this . _commitMarkedFiles }
231
+ onCommit = { this . commitMarkedFiles }
199
232
/>
200
233
) ;
201
234
} else {
202
235
msg = (
203
236
< CommitBox
204
237
hasFiles = { this . state . stagedFiles . length > 0 }
205
- onCommit = { this . _commitStagedFiles }
238
+ onCommit = { this . commitStagedFiles }
206
239
/>
207
240
) ;
208
241
}
@@ -271,39 +304,6 @@ export class GitPanel extends React.Component<
271
304
) ;
272
305
}
273
306
274
- /**
275
- * Commits all marked files.
276
- *
277
- * @param message - commit message
278
- * @returns a promise which commits the files
279
- */
280
- private _commitMarkedFiles = async ( message : string ) : Promise < void > => {
281
- await this . props . model . reset ( ) ;
282
- await this . props . model . add ( ...this . _markedFiles . map ( file => file . to ) ) ;
283
- await this . _commitStagedFiles ( message ) ;
284
- } ;
285
-
286
- /**
287
- * Commits all staged files.
288
- *
289
- * @param message - commit message
290
- * @returns a promise which commits the files
291
- */
292
- private _commitStagedFiles = async ( message : string ) : Promise < void > => {
293
- try {
294
- if (
295
- message &&
296
- message !== '' &&
297
- ( await this . _hasIdentity ( this . props . model . pathRepository ) )
298
- ) {
299
- await this . props . model . commit ( message ) ;
300
- }
301
- } catch ( error ) {
302
- console . error ( error ) ;
303
- showErrorMessage ( 'Fail to commit' , error ) ;
304
- }
305
- } ;
306
-
307
307
/**
308
308
* List of modified files (both staged and unstaged).
309
309
*/
0 commit comments