Selaa lähdekoodia

Fixes #1150 - issues with no remotes

main
Eric Amodio 4 vuotta sitten
vanhempi
commit
d3ec7022bc
2 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. +6
    -0
      CHANGELOG.md
  2. +4
    -0
      src/git/models/remote.ts

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

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Fixed
- Fixes [#1150](https://github.com/eamodio/vscode-gitlens/issues/1150) - Cannot read property 'provider' of undefined
## [11.0.0] - 2020-11-14
### Added

+ 4
- 0
src/git/models/remote.ts Näytä tiedosto

@ -12,6 +12,8 @@ export class GitRemote<
TProvider extends RemoteProvider | undefined = RemoteProvider | RemoteProviderWithApi | undefined
> {
static getHighlanderProviders(remotes: GitRemote<RemoteProvider>[]) {
if (remotes.length === 0) return undefined;
const remote = remotes.length === 1 ? remotes[0] : remotes.find(r => r.default);
if (remote != null) return [remote.provider];
@ -22,6 +24,8 @@ export class GitRemote<
}
static getHighlanderProviderName(remotes: GitRemote<RemoteProvider>[]) {
if (remotes.length === 0) return undefined;
const remote = remotes.length === 1 ? remotes[0] : remotes.find(r => r.default);
if (remote != null) return remote.provider.name;

Ladataan…
Peruuta
Tallenna