extensions/git/src/commands.ts/CommandCenter/promptForBranchName
class CommandCenter:	private async promptForBranchName(repository: Repository, defaultName?: string, initialValue?: string): Promise<string> {
		const config = workspace.getConfiguration('git');
		const branchPrefix = config.get<string>('branchPrefix')!;
		const branchWhitespaceChar = config.get<string>('branchWhitespaceChar')!;
		const branchValidationRegex = config.get<string>('branchValidationRegex')!;
		const sanitize = (name: string) => name ?
			name.trim().replace(/^-+/, '').replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, branchWhitespaceChar)
			: name;

		let rawBranchName = defaultName;

		if (!rawBranchName) {
			// Branch name
			if (!initialValue) {
				const branchRandomNameEnabled = config.get<boolean>('branchRandomName.enable', false);
				initialValue = `${branchPrefix}${branchRandomNameEnabled ? this.generateRandomBranchName(repository, branchWhitespaceChar) : ''}`;
			}

			// Branch name selection
			const initialValueSelection: [number, number] | undefined =
				initialValue.startsWith(branchPrefix) ? [branchPrefix.length, initialValue.length] : undefined;

			rawBranchName = await window.showInputBox({
				placeHolder: l10n.t('Branch name'),
				prompt: l10n.t('Please provide a new branch name'),
				value: initialValue,
				valueSelection: initialValueSelection,
				ignoreFocusOut: true,
				validateInput: (name: string) => {
					const validateName = new RegExp(branchValidationRegex);
					const sanitizedName = sanitize(name);
					if (validateName.test(sanitizedName)) {
						// If the sanitized name that we will use is different than what is
						// in the input box, show an info message to the user informing them
						// the branch name that will be used.
						return name === sanitizedName
							? null
							: {
								message: l10n.t('The new branch will be "{0}"', sanitizedName),
								severity: InputBoxValidationSeverity.Info
							};
					}

					return l10n.t('Branch name needs to match regex: {0}', branchValidationRegex);
				}
			});
		}

		return sanitize(rawBranchName || '');
	}