🖊 Include branch name in commit button popup (#167827)

* 🖊 Include branch name in commit button popup

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* 🖊 Include branch name in "Publish" button popup

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
This commit is contained in:
Babak K. Shandiz 2023-01-12 16:22:34 +03:30 committed by GitHub
parent 82305d3a31
commit ea85d0ce72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -146,8 +146,12 @@ export class ActionButtonCommand {
command: 'git.publish',
title: l10n.t({ message: '{0} Publish Branch', args: [icon], comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }),
tooltip: this.state.isSyncInProgress ?
l10n.t({ message: 'Publishing Branch...', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }) :
l10n.t({ message: 'Publish Branch', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }),
(this.state.HEAD?.name ?
l10n.t({ message: 'Publishing Branch \'{0}\'...', args: [this.state.HEAD.name], comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }) :
l10n.t({ message: 'Publishing Branch...', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] })) :
(this.repository.HEAD?.name ?
l10n.t({ message: 'Publish Branch \'{0}\'', args: [this.state.HEAD?.name], comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }) :
l10n.t({ message: 'Publish Branch', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] })),
arguments: [this.repository.sourceControl],
},
enabled: !this.state.isSyncInProgress

View file

@ -174,9 +174,12 @@ export class CommitCommandsCenter {
const icon = alwaysPrompt ? '$(lock)' : alwaysCommitToNewBranch ? '$(git-branch)' : undefined;
// Tooltip (default)
let tooltip = !alwaysCommitToNewBranch ?
l10n.t('Commit Changes') :
l10n.t('Commit Changes to New Branch');
const branch = this.repository.HEAD?.name;
let tooltip = alwaysCommitToNewBranch ?
l10n.t('Commit Changes to New Branch') :
branch ?
l10n.t('Commit Changes on \'{0}\'', branch) :
l10n.t('Commit Changes');
// Tooltip (in progress)
if (this.repository.operations.isRunning(OperationKind.Commit)) {