src/vs/workbench/contrib/scm/common/scmService.ts/SCMInput/constructor
class SCMInput:	constructor(
		readonly repository: ISCMRepository,
		@IStorageService private storageService: IStorageService
	) {
		const historyKey = `scm/input:${this.repository.provider.label}:${this.repository.provider.rootUri?.path}`;
		let history: string[] | undefined;
		let rawHistory = this.storageService.get(historyKey, StorageScope.GLOBAL, '');

		if (rawHistory) {
			try {
				history = JSON.parse(rawHistory);
			} catch {
				// noop
			}
		}

		if (!history || history.length === 0) {
			history = [this._value];
		} else {
			this._value = history[history.length - 1];
		}

		this.historyNavigator = new HistoryNavigator2(history, 50);

		this.storageService.onWillSaveState(e => {
			if (this.historyNavigator.isAtEnd()) {
				this.historyNavigator.replaceLast(this._value);
			}

			if (this.repository.provider.rootUri) {
				this.storageService.store(historyKey, JSON.stringify([...this.historyNavigator]), StorageScope.GLOBAL, StorageTarget.USER);
			}
		});
	}