Selaa lähdekoodia

Refines merge/rebase messaging when up to date

Refs: #1660
main
Eric Amodio 1 vuosi sitten
vanhempi
commit
b2b5b93029
3 muutettua tiedostoa jossa 19 lisäystä ja 6 poistoa
  1. +1
    -0
      CHANGELOG.md
  2. +9
    -3
      src/commands/git/merge.ts
  3. +9
    -3
      src/commands/git/rebase.ts

+ 1
- 0
CHANGELOG.md Näytä tiedosto

@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Changed ### Changed
- Improves accuracy, performance, and memory usage related to parsing diffs, used in _Changes_ hovers, _Changes_ file annotations, etc - Improves accuracy, performance, and memory usage related to parsing diffs, used in _Changes_ hovers, _Changes_ file annotations, etc
- Refines merge/rebase messaging when there is nothing to do — refs [#1660](https://github.com/gitkraken/vscode-gitlens/issues/1660)
### Fixed ### Fixed

+ 9
- 3
src/commands/git/merge.ts Näytä tiedosto

@ -212,14 +212,20 @@ export class MergeGitCommand extends QuickCommand {
const count = aheadBehind != null ? aheadBehind.ahead + aheadBehind.behind : 0; const count = aheadBehind != null ? aheadBehind.ahead + aheadBehind.behind : 0;
if (count === 0) { if (count === 0) {
const step: QuickPickStep<DirectiveQuickPickItem> = this.createConfirmStep( const step: QuickPickStep<DirectiveQuickPickItem> = this.createConfirmStep(
appendReposToTitle(`Confirm ${context.title}`, state, context),
appendReposToTitle(context.title, state, context),
[], [],
createDirectiveQuickPickItem(Directive.Cancel, true, { createDirectiveQuickPickItem(Directive.Cancel, true, {
label: `Cancel ${this.title}`,
label: 'OK',
detail: `${getReferenceLabel(context.destination, { detail: `${getReferenceLabel(context.destination, {
capitalize: true, capitalize: true,
})} is up to date with ${getReferenceLabel(state.reference)}`,
})} is already up to date with ${getReferenceLabel(state.reference)}`,
}), }),
{
placeholder: `Nothing to merge; ${getReferenceLabel(context.destination, {
label: false,
icon: false,
})} is already up to date`,
},
); );
const selection: StepSelection<typeof step> = yield step; const selection: StepSelection<typeof step> = yield step;
canPickStepContinue(step, state, selection); canPickStepContinue(step, state, selection);

+ 9
- 3
src/commands/git/rebase.ts Näytä tiedosto

@ -223,14 +223,20 @@ export class RebaseGitCommand extends QuickCommand {
const count = aheadBehind != null ? aheadBehind.ahead + aheadBehind.behind : 0; const count = aheadBehind != null ? aheadBehind.ahead + aheadBehind.behind : 0;
if (count === 0) { if (count === 0) {
const step: QuickPickStep<DirectiveQuickPickItem> = this.createConfirmStep( const step: QuickPickStep<DirectiveQuickPickItem> = this.createConfirmStep(
appendReposToTitle(`Confirm ${context.title}`, state, context),
appendReposToTitle(context.title, state, context),
[], [],
createDirectiveQuickPickItem(Directive.Cancel, true, { createDirectiveQuickPickItem(Directive.Cancel, true, {
label: `Cancel ${this.title}`,
label: 'OK',
detail: `${getReferenceLabel(context.destination, { detail: `${getReferenceLabel(context.destination, {
capitalize: true, capitalize: true,
})} is up to date with ${getReferenceLabel(state.reference)}`,
})} is already up to date with ${getReferenceLabel(state.reference)}`,
}), }),
{
placeholder: `Nothing to rebase; ${getReferenceLabel(context.destination, {
label: false,
icon: false,
})} is already up to date`,
},
); );
const selection: StepSelection<typeof step> = yield step; const selection: StepSelection<typeof step> = yield step;
canPickStepContinue(step, state, selection); canPickStepContinue(step, state, selection);

Ladataan…
Peruuta
Tallenna