diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index f98206b58a1b8..76fab62e8988b 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -50,11 +50,15 @@ export class GitScmProvider implements ScmProvider { this.onDidChangeEmitter.fire(undefined); } + private readonly onDidChangeCommitTemplateEmitter = new Emitter(); + readonly onDidChangeCommitTemplate = this.onDidChangeCommitTemplateEmitter.event; + private readonly onDidChangeStatusBarCommandsEmitter = new Emitter(); readonly onDidChangeStatusBarCommands = this.onDidChangeStatusBarCommandsEmitter.event; private readonly toDispose = new DisposableCollection( this.onDidChangeEmitter, + this.onDidChangeCommitTemplateEmitter, this.onDidChangeStatusBarCommandsEmitter ); diff --git a/packages/scm/src/browser/scm-commit-widget.tsx b/packages/scm/src/browser/scm-commit-widget.tsx index 7f1d19a1e21b1..d873497323f3c 100644 --- a/packages/scm/src/browser/scm-commit-widget.tsx +++ b/packages/scm/src/browser/scm-commit-widget.tsx @@ -71,6 +71,9 @@ export class ScmCommitWidget extends ReactWidget implements StatefulWidget { this.toDisposeOnRepositoryChange.push(repository.provider.onDidChange(async () => { this.update(); })); + this.toDisposeOnRepositoryChange.push(repository.provider.onDidChangeCommitTemplate(e => { + this.setInputValue(e); + })); } } diff --git a/packages/scm/src/browser/scm-provider.ts b/packages/scm/src/browser/scm-provider.ts index 10e71b5281bdd..fcb8b711ab600 100644 --- a/packages/scm/src/browser/scm-provider.ts +++ b/packages/scm/src/browser/scm-provider.ts @@ -32,6 +32,8 @@ export interface ScmProvider extends Disposable { readonly statusBarCommands?: ScmCommand[]; readonly onDidChangeStatusBarCommands?: Event; + readonly onDidChangeCommitTemplate: Event; + readonly amendSupport?: ScmAmendSupport; }