mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Git - Commit action button fix (#199475)
This commit is contained in:
parent
60ff5faba4
commit
aebfa4798c
|
@ -219,6 +219,16 @@ export class CommitActionButton extends AbstractActionButton {
|
|||
};
|
||||
}
|
||||
|
||||
// Not a branch (tag, detached)
|
||||
if (this.state.HEAD?.type === RefType.Tag || !this.state.HEAD?.name) {
|
||||
return {
|
||||
command: 'git.commit',
|
||||
title: l10n.t('{0} Commit', '$(check)'),
|
||||
tooltip: this.state.isCommitInProgress ? l10n.t('Committing Changes...') : l10n.t('Commit Changes'),
|
||||
arguments: [this.repository.sourceControl, '']
|
||||
};
|
||||
}
|
||||
|
||||
// Commit
|
||||
return this.postCommitCommandCenter.getPrimaryCommand();
|
||||
}
|
||||
|
@ -229,6 +239,11 @@ export class CommitActionButton extends AbstractActionButton {
|
|||
return [];
|
||||
}
|
||||
|
||||
// Not a branch (tag, detached)
|
||||
if (this.state.HEAD?.type === RefType.Tag || !this.state.HEAD?.name) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Commit
|
||||
const commandGroups: Command[][] = [];
|
||||
for (const commands of this.postCommitCommandCenter.getSecondaryCommands()) {
|
||||
|
|
Loading…
Reference in a new issue