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;