Skip to content

Commit f47327f

Browse files
authored
Git - fix branch creation regression (microsoft#182504)
1 parent b436869 commit f47327f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/git/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ function getCheckoutProcessor(repository: Repository, type: string): CheckoutPro
308308
}
309309

310310
function sanitizeBranchName(name: string, whitespaceChar: string): string {
311-
return name.trim().replace(/^-+/, '').replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, whitespaceChar);
311+
return name ? name.trim().replace(/^-+/, '').replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, whitespaceChar) : name;
312312
}
313313

314314
function sanitizeRemoteName(name: string) {

0 commit comments

Comments
 (0)