From ac035214a7909052cb9830a92ececa1bc54a3aff Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 9 Dec 2021 21:57:47 +0100 Subject: [PATCH] fix broken SCM view --- src/vs/workbench/api/common/extHostSCM.ts | 1 + src/vs/workbench/contrib/scm/common/scmService.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostSCM.ts b/src/vs/workbench/api/common/extHostSCM.ts index 574976beb09..459e6529f5b 100644 --- a/src/vs/workbench/api/common/extHostSCM.ts +++ b/src/vs/workbench/api/common/extHostSCM.ts @@ -206,6 +206,7 @@ export class ExtHostSCMInputBox implements vscode.SourceControlInputBox { } set value(value: string) { + value = value ?? ''; this._proxy.$setInputBoxValue(this._sourceControlHandle, value); this.updateValue(value); } diff --git a/src/vs/workbench/contrib/scm/common/scmService.ts b/src/vs/workbench/contrib/scm/common/scmService.ts index 953bcd231ec..7b642f48b4a 100644 --- a/src/vs/workbench/contrib/scm/common/scmService.ts +++ b/src/vs/workbench/contrib/scm/common/scmService.ts @@ -147,6 +147,7 @@ class SCMInput implements ISCMInput { if (key) { try { history = JSON.parse(this.storageService.get(key, StorageScope.GLOBAL, '')).history; + history = history?.filter(s => !!s); } catch { // noop } @@ -171,7 +172,7 @@ class SCMInput implements ISCMInput { return; } - const history = [...this.historyNavigator]; + const history = [...this.historyNavigator].filter(s => !!s); if (history.length === 0 || (history.length === 1 && history[0] === '')) { return;