This repository was archived by the owner on Aug 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -101,20 +101,24 @@ module.exports = class Status {
101101
102102 if ( connection ) {
103103 if ( repo . canUseGit ( ) && await repo . isGitRepo ( ) ) {
104- const message = await vscode . window . showInputBox ( {
105- prompt : `Commit message`
106- } ) ;
107-
108- if ( message ) {
109- try {
110- await repo . commit ( message ) ;
111- await vscode . commands . executeCommand ( `git-client-ibmi.commits.refresh` ) ;
112- vscode . window . showInformationMessage ( `Commit successful.` ) ;
113- } catch ( e ) {
114- vscode . window . showErrorMessage ( `Error making commit in ${ repoPath } . ${ e } ` ) ;
115- }
104+ if ( this . status && this . status . staged && this . status . staged . length > 0 ) {
105+ const message = await vscode . window . showInputBox ( {
106+ prompt : `Commit message`
107+ } ) ;
116108
117- this . refresh ( ) ;
109+ if ( message ) {
110+ try {
111+ await repo . commit ( message ) ;
112+ await vscode . commands . executeCommand ( `git-client-ibmi.commits.refresh` ) ;
113+ vscode . window . showInformationMessage ( `Commit successful.` ) ;
114+ } catch ( e ) {
115+ vscode . window . showErrorMessage ( `Error making commit in ${ repoPath } . ${ e } ` ) ;
116+ }
117+
118+ this . refresh ( ) ;
119+ }
120+ } else {
121+ vscode . window . showErrorMessage ( `To make a commit you must stage your changes.` ) ;
118122 }
119123 }
120124 }
You can’t perform that action at this time.
0 commit comments