Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,19 +1717,21 @@ export class CommandCenter {

@command('git.commitMessageAccept')
async commitMessageAccept(arg?: Uri): Promise<void> {
if (!arg) { return; }
Comment thread
Ilanaya marked this conversation as resolved.
if (!arg && !window.activeTextEditor) { return; }
arg ??= window.activeTextEditor!.document.uri;

// Close the tab
this._closeEditorTab(arg);
}

@command('git.commitMessageDiscard')
async commitMessageDiscard(arg?: Uri): Promise<void> {
if (!arg) { return; }
Comment thread
Ilanaya marked this conversation as resolved.
if (!arg && !window.activeTextEditor) { return; }
arg ??= window.activeTextEditor!.document.uri;

// Clear the contents of the editor
const editors = window.visibleTextEditors
.filter(e => e.document.languageId === 'git-commit' && e.document.uri.toString() === arg.toString());
.filter(e => e.document.languageId === 'git-commit' && e.document.uri.toString() === arg!.toString());

if (editors.length !== 1) { return; }

Expand Down