@@ -914,7 +914,6 @@ export class Repository implements Disposable {
914
914
const root = Uri . file ( repository . root ) ;
915
915
this . _sourceControl = scm . createSourceControl ( 'git' , 'Git' , root ) ;
916
916
917
- this . _sourceControl . acceptInputCommand = { command : 'git.commit' , title : localize ( 'commit' , "Commit" ) , arguments : [ this . _sourceControl ] } ;
918
917
this . _sourceControl . quickDiffProvider = this ;
919
918
this . _sourceControl . inputBox . validateInput = this . validateInput . bind ( this ) ;
920
919
this . disposables . push ( this . _sourceControl ) ;
@@ -951,6 +950,17 @@ export class Repository implements Disposable {
951
950
|| e . affectsConfiguration ( 'git.showActionButton' , root )
952
951
) ( this . updateModelState , this , this . disposables ) ;
953
952
953
+ const updateInputBoxAcceptInputCommand = ( ) => {
954
+ const config = workspace . getConfiguration ( 'git' , root ) ;
955
+ const postCommitCommand = config . get < string > ( 'postCommitCommand' ) ;
956
+ const postCommitCommandArg = postCommitCommand === 'push' || postCommitCommand === 'sync' ? `git.${ postCommitCommand } ` : '' ;
957
+ this . _sourceControl . acceptInputCommand = { command : 'git.commit' , title : localize ( 'commit' , "Commit" ) , arguments : [ this . _sourceControl , postCommitCommandArg ] } ;
958
+ } ;
959
+
960
+ const onConfigListenerForPostCommitCommand = filterEvent ( workspace . onDidChangeConfiguration , e => e . affectsConfiguration ( 'git.postCommitCommand' , root ) ) ;
961
+ onConfigListenerForPostCommitCommand ( updateInputBoxAcceptInputCommand , this , this . disposables ) ;
962
+ updateInputBoxAcceptInputCommand ( ) ;
963
+
954
964
const updateInputBoxVisibility = ( ) => {
955
965
const config = workspace . getConfiguration ( 'git' , root ) ;
956
966
this . _sourceControl . inputBox . visible = config . get < boolean > ( 'showCommitInput' , true ) ;
0 commit comments