@@ -914,7 +914,6 @@ export class Repository implements Disposable {
914914 const root = Uri . file ( repository . root ) ;
915915 this . _sourceControl = scm . createSourceControl ( 'git' , 'Git' , root ) ;
916916
917- this . _sourceControl . acceptInputCommand = { command : 'git.commit' , title : localize ( 'commit' , "Commit" ) , arguments : [ this . _sourceControl ] } ;
918917 this . _sourceControl . quickDiffProvider = this ;
919918 this . _sourceControl . inputBox . validateInput = this . validateInput . bind ( this ) ;
920919 this . disposables . push ( this . _sourceControl ) ;
@@ -951,6 +950,17 @@ export class Repository implements Disposable {
951950 || e . affectsConfiguration ( 'git.showActionButton' , root )
952951 ) ( this . updateModelState , this , this . disposables ) ;
953952
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+
954964 const updateInputBoxVisibility = ( ) => {
955965 const config = workspace . getConfiguration ( 'git' , root ) ;
956966 this . _sourceControl . inputBox . visible = config . get < boolean > ( 'showCommitInput' , true ) ;
0 commit comments