@@ -2103,38 +2103,36 @@ export class CommandCenter {
2103
2103
}
2104
2104
}
2105
2105
2106
- if ( ! opts . amend ) {
2107
- // no changes, and the user has not configured to commit all in this case
2108
- if ( ! noUnstagedChanges && noStagedChanges && ! enableSmartCommit && ! opts . all ) {
2109
- const suggestSmartCommit = config . get < boolean > ( 'suggestSmartCommit' ) === true ;
2106
+ // no changes, and the user has not configured to commit all in this case
2107
+ if ( ! noUnstagedChanges && noStagedChanges && ! enableSmartCommit && ! opts . all ) {
2108
+ const suggestSmartCommit = config . get < boolean > ( 'suggestSmartCommit' ) === true ;
2110
2109
2111
- if ( ! suggestSmartCommit ) {
2112
- return ;
2113
- }
2114
-
2115
- // prompt the user if we want to commit all or not
2116
- const message = l10n . t ( 'There are no staged changes to commit.\n\nWould you like to stage all your changes and commit them directly?' ) ;
2117
- const yes = l10n . t ( 'Yes' ) ;
2118
- const always = l10n . t ( 'Always' ) ;
2119
- const never = l10n . t ( 'Never' ) ;
2120
- const pick = await window . showWarningMessage ( message , { modal : true } , yes , always , never ) ;
2121
-
2122
- if ( pick === always ) {
2123
- config . update ( 'enableSmartCommit' , true , true ) ;
2124
- } else if ( pick === never ) {
2125
- config . update ( 'suggestSmartCommit' , false , true ) ;
2126
- return ;
2127
- } else if ( pick !== yes ) {
2128
- return ; // do not commit on cancel
2129
- }
2110
+ if ( ! suggestSmartCommit ) {
2111
+ return ;
2130
2112
}
2131
2113
2132
- if ( opts . all === undefined ) {
2133
- opts = { ...opts , all : noStagedChanges } ;
2134
- } else if ( ! opts . all && noStagedChanges ) {
2135
- opts = { ...opts , all : true } ;
2114
+ // prompt the user if we want to commit all or not
2115
+ const message = l10n . t ( 'There are no staged changes to commit.\n\nWould you like to stage all your changes and commit them directly?' ) ;
2116
+ const yes = l10n . t ( 'Yes' ) ;
2117
+ const always = l10n . t ( 'Always' ) ;
2118
+ const never = l10n . t ( 'Never' ) ;
2119
+ const pick = await window . showWarningMessage ( message , { modal : true } , yes , always , never ) ;
2120
+
2121
+ if ( pick === always ) {
2122
+ config . update ( 'enableSmartCommit' , true , true ) ;
2123
+ } else if ( pick === never ) {
2124
+ config . update ( 'suggestSmartCommit' , false , true ) ;
2125
+ return ;
2126
+ } else if ( pick !== yes ) {
2127
+ return ; // do not commit on cancel
2136
2128
}
2137
2129
}
2130
+
2131
+ if ( opts . all === undefined ) {
2132
+ opts = { ...opts , all : noStagedChanges } ;
2133
+ } else if ( ! opts . all && noStagedChanges ) {
2134
+ opts = { ...opts , all : true } ;
2135
+ }
2138
2136
}
2139
2137
2140
2138
// enable signing of commits if configured
0 commit comments