소스 검색

Fixes #1150 - issues with no remotes

main
Eric Amodio 4 년 전
부모
커밋
d3ec7022bc
2개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. +6
    -0
      CHANGELOG.md
  2. +4
    -0
      src/git/models/remote.ts

+ 6
- 0
CHANGELOG.md 파일 보기

@ -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/). 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 ## [11.0.0] - 2020-11-14
### Added ### Added

+ 4
- 0
src/git/models/remote.ts 파일 보기

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

불러오는 중...
취소
저장