Bladeren bron

Fixes #1285 - avoids fetch on current branch

main
Eric Amodio 3 jaren geleden
bovenliggende
commit
de692bd58a
2 gewijzigde bestanden met toevoegingen van 10 en 3 verwijderingen
  1. +1
    -0
      CHANGELOG.md
  2. +9
    -3
      src/commands/git/pull.ts

+ 1
- 0
CHANGELOG.md Bestand weergeven

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed ### Fixed
- Fixes [#1285](https://github.com/eamodio/vscode-gitlens/issues/1285) - Uncommitted staged changes after pull
- Fixes [#1294](https://github.com/eamodio/vscode-gitlens/issues/1294) - Error when open commits list - Fixes [#1294](https://github.com/eamodio/vscode-gitlens/issues/1294) - Error when open commits list
## [11.1.0] - 2020-12-23 ## [11.1.0] - 2020-12-23

+ 9
- 3
src/commands/git/pull.ts Bestand weergeven

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import { Container } from '../../container'; import { Container } from '../../container';
import { GitBranchReference, GitReference, Repository } from '../../git/git';
import { GitBranch, GitBranchReference, GitReference, Repository } from '../../git/git';
import { import {
appendReposToTitle, appendReposToTitle,
PartialStepState, PartialStepState,
@ -57,9 +57,15 @@ export class PullGitCommand extends QuickCommand {
}; };
} }
execute(state: PullStepState) {
async execute(state: PullStepState) {
if (GitReference.isBranch(state.reference)) { if (GitReference.isBranch(state.reference)) {
return state.repos[0].fetch({ branch: state.reference });
// Only resort to a branch fetch if the branch isn't the current one
if (!GitBranch.is(state.reference) || !state.reference.current) {
const currentBranch = await state.repos[0].getBranch();
if (currentBranch?.name !== state.reference.name) {
return state.repos[0].fetch({ branch: state.reference });
}
}
} }
return Container.git.pullAll(state.repos, { rebase: state.flags.includes('--rebase') }); return Container.git.pullAll(state.repos, { rebase: state.flags.includes('--rebase') });

Laden…
Annuleren
Opslaan